javascript - RactiveJS and Stapes model not updating -


i trying create filtering stapes object in ractivejs, seem 2 way binding not responding correctly update.

i can't work out going wrong thought should work without issue, have created code example here:

https://jsbin.com/sajeje/4/edit?html,output

here's pattern use using computed property filter adapted use case. couldn't stapes object directly usable result, there getallasarray() seems work:

  computed: {     filtered: function () {        var query = this.get( 'query').trim(),            users = this.get( 'users' );        return query ? users.search(query) : users.getallasarray();     }   },    data: function () {     return {       users: usersmodel,       query: ''     }   } 

works sub-component pure reactive programming without need event:

<search query="{{query}}" placeholder="search users" /> 

updated bin here: https://jsbin.com/bomumajagu/edit?html,output

push works against stapes model:

this.get( 'users' ).push( { name: newuser } ); 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -