Updating the state

As mentioned before, all data in fig sits peacefully on the instance's .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.

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!

app.js
Component.fig

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.

app.js
Component.fig