StateMachine Utility (developed using native JavaScript Object.prototype property)
https://github.com/sshams/puremvc-js-util-statemachineLockableDoor Demo
https://github.com/sshams/puremvc-js-demo-lockabledoorThe Demo also demonstrated a simple solution for communication between component and a Mediator that PureMVC JS community has been struggling with or have questions about, it's a Delegation Pattern in JavaScript using closures for communication between viewComponent and it's Mediator. Inspired by Objective-C Demo where the viewComponents communicates to it's Mediator via a Delegate. Have a look at the following.
https://github.com/sshams/puremvc-js-demo-lockabledoor/blob/master/js/view/ApplicationMediator.jshttps://github.com/sshams/puremvc-js-demo-lockabledoor/blob/master/js/LockableDoor.jsInside onRegister a closure was defined and is passed to the viewComponent, viewComponent only knows about functions within that closure and has no information about it's Mediator hence it's loosely coupled, that closure has reference to Mediator that can then call function of the Mediator. Closures are big and powerful in JavaScript and solved many problems.
This approach eliminates the need of any 3rd party utilities/libraries for dispatching events or Signals, you're free to use any for their benefits but my intent was to develop the demo in it's purest form and without depending upon any library, and just utilizing the power of the language and the PureMVC framework itself.