You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hai Phan edited this page Jun 25, 2018
·
10 revisions
Session Support
If the model object defines the methods "onConnect" and "onDisconnect", they will be called automatically when a client connects and when it disconnects. The special property session holds an object that is visible only to the current client.
By default, any property that begins with the underscore character are private and not seen by clients (cannot be subscribed to). To change this behavior:
require("push-model").options.excludeProperty=function(obj,prop){//return true to exclude this property//return typeof prop == "string" && prop.startsWith("_")}
Splice Patch
This module uses the jsonpatch-observe library, which can generate a non-standard "splice" patch for array changes. Without this, array changes have to be represented as a series of single-element add/removes, which is quite inefficient. The splice patch is enabled by default, make sure your client can handle this patch. To disable this feature, do: