Child pages
  • Specification (.spec file)

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Data synchronization
Anchor
pushToServer
pushToServer

Data modifications are automatically propagated from server to client.

For performance (and security) reasons, data modifications from client to server are not propagated by default. To enable this configure pushToServer setting on the property.

pushToServer valuedescription
rejectthis is the default, no data synchronization from client to server for this property
allowdata changes from client to server are allowed
shallowsame as allow, but sablo will also add a watch on the model (in the client) and send changes to the server; the watch is based on object reference/primitive value (more performant, but in case of structured/nested objects it will only trigger data synchronization when the objects are different by reference, even if they are actually 'equal' by content)
deep

same as allow, but sablo will also add a watch on the model (in the client) and send changes to the server; the watch is based on object equality (compares old and new values of structured/nested objects, less performant because it keeps and compares two copies of structured/nested objects); "deep" is mostly meant to be used for properties of type 'object' - that  can contain nested JSON - and that for any change (doesn't matter how little) will send over the complete value to the server.

 

Information about how "pushToServer" works in particular with Array property type and with Custom object property types can be found on the wiki pages of these property types.

 

For example:

Code Block
languagejs
titlepushToServer example
"model": {
   "searchfield": { "type": "string", "pushToServer": "shallow" }
} 

...