Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (20 sloc) 827 Bytes
extends ../docs-base
block doc
h1 Bus messaging
p.
All data in from components in fig going upwards is meant to flow
through the #[b event bus]. It can be accessed through the
#[b .on], #[b .once], #[b .off] and #[b .emit] methods of the fig
instance, or with the #[b emit] parameter passed to a component.
p.
The methods do what their names' suggest, meant to be used the same as
node's built-in EventEmitter. For detailed usage, see the
#[a(href='/docs/api#todo') API reference].
include ../../examples/bus-messaging
h2 Instance events
p.
Fig emits the following events on all of its instances:
.nest
p #[b fig ready] is emitted after the app is mounted and rendered.
p #[b fig update pre] is emitted right before the view is updated.
p #[b fig update] is emitted after the view gets updated.