json-data-proxy v0.2.3
API Reference
Note:
Never manually invoke methods which begin with '_' as they are meant for internal use within the JsonProxy.
json-data-proxy~JsonProxy
Provides an interface to manage JSON data parity between FS and in-code.
Kind: inner property of json-data-proxy
Example
const JsonProxy = require('json-proxy');
jsonProxy.addListener(listener) ⇒ number
Adds a listener to the queue.
Kind: instance method of JsonProxy
Returns: number - Unique id for the listener.
Param | Type |
---|---|
listener | Array.<VoidFunction> |
jsonProxy.removeListener(id)
Removes a listener from the queue.
Kind: instance method of JsonProxy
Param | Type | Description |
---|---|---|
id | number | Unique id for the listener. |
jsonProxy._refreshProxy()
Reconstructs the proxy to reflect latest changes. Warning: This will make the previous proxy object obsolete. This could be dangerous if the proxy object has been passed into other places.
Kind: instance method of JsonProxy
jsonProxy._update()
Updates the file to reflect the latest JSON state.
Kind: instance method of JsonProxy
jsonProxy._onContentChange(jsonProxy)
Fired when an FS change is detected.
Kind: instance method of JsonProxy
Param |
---|
jsonProxy |
jsonProxy.destroy()
Destroys this instance of JsonProxy.
Kind: instance method of JsonProxy