Skip to content

Instantly share code, notes, and snippets.

@lifeart
Last active November 27, 2017 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lifeart/e772c8928505e89fa770fedf403c2f6f to your computer and use it in GitHub Desktop.
Save lifeart/e772c8928505e89fa770fedf403c2f6f to your computer and use it in GitHub Desktop.
example
{
beforeModel(params) {
if (this.store.peekAll('item').length > MAX_IN_MEMORY_OBJECTS) {
this.store.unloadAll('item');
}
},
model(params) {
return this.ajax('getCoordsByAdress', params.address)
.then(coords=>{
return this.store.query('item', {x: coords.x, y: coords:y, radius: 10, maxItems: 100})
});
},
actions: {
itemClick(item) {
this.transitionTo('items.item', item);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment