Skip to content

API extensions

Compare
Choose a tag to compare
@gaperton gaperton released this 11 May 07:29
· 174 commits to master since this release
  • API for links cache, dramatically simplifying forms data binding:
    • All links created with Link.state are cached, and are recreated only when value is different.
    • const links = Link.all( this, 'attr1', 'attr2', ... ) makes sure that links for specified state members
      are cached, and returns the reference to the cache. Thus, links.attr1 is the direct reference to the link.
    • Links cache is directly accessible in render() with this.links.
  • Link methods for purely functional updates of the enclosed object:
    • Links to arrays: unshift(...), push(...), splice(...) proxy call to native Array methods.
    • Links to arrays and objects: remove( key ) removes element with specified key.
    • Links to array and object members: remove() removes element from parent object or array.
  • Methods for links to objects and arrays:
    • link.pick( key1, key2, ... ) creates an object with links to listed object members, in the same way as Link.all.
    • link.clone() creates shallow copy of the enclosed object.
  • Added "Users List" application example.