Durandal's composition and activator services allow optional callbacks to control or hook into their life cycles. They can be useful when performing setup and teardown, or implementing logic to block or redirect page changes.
An activator is a special computed observable, whose write
function enforces the activation life cycle. Unless you are managing composition or routing yourself, the only activators you will work with are the ones used by the router and the dialog system. Though, if you are interested, you can create your own activator by requiring in the durandal/activator
module and using the create
function.
The following optional properties are called by the activator when the active value tries to change: