ractive.set()
edit this pageUpdates data and triggers a re-render of any mustaches that are affected (directly or indirectly) by the change. Any observers of affected keypaths will be notified.
A set
event will be fired with keypath
and value
as arguments (or map
, if you set multiple options at once).
ractive.set( keypath, value[, complete ])
Returns
ractive
keypath
String
The keypath of the data we're changing, e.g.
user
oruser.name
oruser.friends[1]
value
The value we're changing it to. Can be a primitive or an object (or array), in which case dependants of downstream keypaths will also be re-rendered (if they have changed)
complete
Function
A function that will be called, with
ractive
asthis
, as soon as all transitions triggered by the change (i.e. elements being added or removed) are completeractive.set( map[, complete ])
Returns
ractive
map
Object
A map of
keypath: value
pairs, as abovecomplete
Function
As above