0.2.3 • Published 3 years ago

json-data-proxy v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

API Reference

Note:

#f03c15 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.

ParamType
listenerArray.<VoidFunction>

jsonProxy.removeListener(id)

Removes a listener from the queue.

Kind: instance method of JsonProxy

ParamTypeDescription
idnumberUnique 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

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago