korest
v0.0.7
Published
Maps JSON object into knockout observable with bound REST actions.
Downloads
11
Readme
korest
Function for knockout.js to map plain object into knockout observable with bound REST actions. Similar to knockout.mapping, but it is more simple and lightweight.
API
ko.rest(obj, options)
- wraps given plain JS object into object with knockout observable fields bound to REST actions. options
:
url
- specifies root url to REST resource.
Wrapper has the following methods.
unwrap():Object
- unwraps to plain JS object.update(obj):void
- updates observable fields with values from given plain JS object.fetch():promise
- fetches latest version of object from server.