Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 788 Bytes
extends ../docs-base
block doc
h1 Updating the state
p.
As mentioned before, all data in fig sits peacefully on the instance's
#[b .state] property. Whenever a change to the state is detected, fig
updates the view with the new data, that means you don't have to call
any function to update the view yourself, it's all being managed for you
under the hood.
p.warn.
The state updates are being detected with JavaScript's ordinary object
setters, therefore any new keys added to the state object will NOT
update the view!
include ../../examples/updating-state
p.
Besides listening for value changes on the object, fig also wraps
all mutating array methods which makes it really easy to update an array
painlessly.
include ../../examples/updating-state-arrays