-
Notifications
You must be signed in to change notification settings - Fork 265
Open
Description
- I have a component with search-by-query. Something like this:
<input value="{{ query }}" />
import {Component} from 'derby';
export class UserSearchForm extends Component {
static readonly is = 'user-search-form';
static readonly view = __dirname;
create() {
this.model.on('all', 'query', () => {
this.onSearch();
});
this.onSearch();
}
onSearch() {
// Omitting unsubscribe old query and other stuff. It does no matter, i tested
let $query = this.model.root.query('user', {some: this.model.get('query')});
$query.subscribe(() => {
this.model.ref('users', $query); // Important to create ref to reproduce the bug
});
}
}
- And page template. Important to create binding with name as-ref (users) and bing it to __page
<view is="user-search-form" users="{{ _page.users }}" />
{{each _page.users as #user}}
{{ #user.id }}<br/>
{{/each}}
- Now run and make some searches - it works. Then change index.html template (let add some symbol) in dev mode with live-update. And search again. And change template and search again and etc.
After several iterates derby will try to write to users
, but there is no sets
in code.
I guess this is because it tries to rewrite old items in _page.users with new search results ot someting like this.
Metadata
Metadata
Assignees
Labels
No labels