2.2.5 • Published 7 years ago
@planet221b/pure-mvc v2.2.5
pure MVC
how to install
npm i @planet221b/pure-mvc@latest
About
Basic Model-View-Controller architecture with extended functionality in TypeScript.
Example project here https://github.com/planet-221b/pureMVC-example.
Added functionalities.
- Mediator have
sleap()andwake()functions, which will give you ability to stop and start mediator from listening notifications dynamically. - Mediator have
subscribeToNotifications()andunsubscribeToNotificationfunctions, which are giving ability to dynamically subscribe and unsubscribe listening notifications.listenNotificationInterestsnow is a getter not a function. - Now it's allowed to have same mediator-view pairs, so for every mediator instance will be generated unique id, which is available in mediator in
idproperty. - Now
facade.retrieveMediatorfunction has optional second propertyid. It's for cases where you have multiple instances of same mediator-view pairs. If you're usingretrieveMediatorfunction without givingidargument, it will return first mediator from mediators with given name. - Now facade has new function
getMediatorsCount(mediatorName: string)which will return count of Mediator with same name. It'd done for cases, when you want to write you own logic based on Mediator count. - Mediator have
indexproperty which shows in which index in the same name mediators list it is, cane be used to different them from each other. - Same notification can call multiple commands, so added functions to remove commands from notification's call queue. To remove single command from call queue call
removeCommand(notification, command)on facade, and to remove all commands from notification's queue callremoveCommands(notification)on facade. - To register command for signle use
registerCommandOnce(notification, command)on facade. So it will called only once, then it will be removed from commands queue. - Added
Guardfor commad, it can be used to make checkes before command will execute, it has reference to facade too. - Added
addGuard(...guardClassRefs), you need to give as argument justGuardclasses, not instances. - Command has protected method
perpare, which is provided to add guards. - Command execution is being done in following sequence,
prepare -> checkGuards -> execute
ToDo
2. Create a TypeScript example with all new functionalities usage. And update attached example.
Description
At the moment, attached example repo is in ES6 and doesn't using all new functionalities
2.2.5
7 years ago
2.2.4
7 years ago
2.2.3
7 years ago
2.2.2
7 years ago
2.2.1
7 years ago
2.2.0
7 years ago
2.0.3
7 years ago
2.0.2
7 years ago
2.0.1
7 years ago
2.0.0
7 years ago
1.1.2
7 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago
0.0.91
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago