ChangeApplier APIThis section explains and documents the various Javascript API calls for instantiating and working with ChangeAppliers. Instantiating a ChangeApplierInstantiating a ChangeApplier is extremely simple. Code Block |
---|
|
var applier = fluid.makeChangeApplier(model);
|
New in v1.3: Code Block |
---|
|
var applier = fluid.makeChangeApplier(model, options);
|
Please see Options below for more information about the new options parameter. Note that this new parameter is independent of the new Transaction support (which also uses options). The makeChangeApplier call takes a single argument, which is the model object (the root of a tree of plain Javascript objects) to which this applier is to be attached. Note that by standard model semantics, whilst any subobjects and properties under this tree can and will change asynchronously, the essential identity of this model tree is defined by this exact object handle model . Therefore to establish agreement amongst model citizens and appliers about which model is being talked about, this object handle must be preserved, whatever happens to the object tree beneath it. The Fluid base framework contains various utility functions which help to make this easy - for example Code Block |
---|
|
fluid.clear(model);
|
is a call which unlinks all properties from the supplied model, preparing it for a wholesale change. A corresponding useful call is Code Block |
---|
|
fluid.model.copyModel(model, newModel)
|
|