ractive.on()

edit this page

Subscribe to events.

ractive.on( eventName, handler )

Returns an Object with a cancel method, which removes the handler.

eventName String

The name of the event to subscribe to

handler Function

The function that will be called, with ractive as this. The arguments depend on the event

ractive.on( obj )

Returns an Object with a cancel method, which removes all handlers in the passed-in obj.

obj Object

An object with keys named for each event to subscribe to. The value at each key is the handler function for that event.