Skip to content

Updatable

Malexion edited this page Nov 3, 2016 · 1 revision

new __.lib.Updatable()

Signifies to __.fuse() that this object instead of being overwritten should call .update(object) passed in the object that would otherwise overwrite this object.

Examples

var config = new __.lib.Config({ // Config from iterate-js inherits from Updatable and implements .update()
   subitem: new __.lib.Config({
      option1: true,
      option2: false
   }),
});

config.update({ subitem: { option2: true } }); // instead of replacing the config subitem it calls update to it.

console.log(config);
Clone this wiki locally