$ npm i icaro -S
Via ES2015 modules
const icaro =
icaro is really fast compared to the other reactive libs because it smartly throttles all the state changes.
const obj =// the variable "changes" here is a Map and the function is asyncobjobjfoo = 'hi'objbar = 'there'objbaz = 'dude'
icaro will also let you listen to nested objects and all the non primitive properties added to an
icaro object will be automatically converted into
icaro observable objects.
const obj =// listen only the changes happening on the root objectobjobjnested =objnestedobjnestedsomeVal = 'hello'
icaro is able also to listen changes in arrays. Any change to the items indexes will dispatch events.
// Here a bit of hardcore async stuffconst arr =// here you will get the index of the items added or who changed their positionarr// initial dispatcharrarr
You can also avoid unsubscribing ("unlisten") because
icaro will automatically remove event listeners when the object is about to be garbage collected.
icaro call will return a Proxy with the following api methods
Listen any object or array calling the callback function asynchronously grouping all the contiguous changes via setImmediate
Unsubscribing a callback previously subscribed to the object, if no callback is provided all the previous subscriptions will be cleared
Return all data contained in an
icaro Proxy as JSON object
All major evergreen browsers (Edge, Chrome, Safari, Firefox) should be supported