nFlow
Hierarchical event dispatcher
Work in progress
API
flow
.create()
.create('name')
.create('name', data)
flow
.name()
.name('test')
flow
.data()
.data({})
.data({},{},{})
flow
.emit()
.emit('name')
.emit('name', data)
.emit(flow2)
flow
.parent()
.parent(null)
.parent(flow)
flow.parents()
flow
.direction()
.direction(flow.direction.DEFAULT)
.direction(flow.direction.UPSTREAM)
.direction(flow.direction.DOWNSTREAM)
.direction(flow.direction.NONE)
flow
.children()
.children.all()
flow
.cancel()
.cancelled()
.cancelled(true)
flow
.stopPropagation()
flow
.on('name')
.on('name', handler)
.on('name', handler1, handler 2)
Internal Events
When a flow object mutates in any way, all connected flow objects are notified of the change.
.data(newData)
triggers:
.on('flow.data', newData, oldData)
on the current flow object.on('flow.children.data', flow, newData, oldData)
on all parent objects.on('flow.parent.data', flow, newData, oldData)
on all child objects (recursively)