Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ember.js Data how to clear datastore

I am experiementing with Ember.js and have setup a small app where users can login and logout. When the user logs out I want to clear all of the currently cached records in the Data Store. Is there a way to do this or would I have to force the browser to reload the page?

like image 797
rundeks Avatar asked Feb 15 '13 21:02

rundeks


1 Answers

I know this question is from 2013. But since Ember Data 1.0.0-beta.17 (May 10, 2015) there's a straightforward way of clearing the datastore:

store.unloadAll()

(More here: http://emberigniter.com/clear-ember-data-store/)

like image 155
Frank Treacy Avatar answered Sep 19 '22 14:09

Frank Treacy