discourse/test/javascripts/helpers/create-store.js.es6

20 lines
429 B
Plaintext
Raw Normal View History

2015-03-07 01:37:24 +08:00
import Store from "discourse/models/store";
import RestAdapter from 'discourse/adapters/rest';
let _restAdapter;
export default function() {
return Store.create({
container: {
lookup(type) {
if (type === "adapter:rest") {
_restAdapter = _restAdapter || RestAdapter.create({ container: this });
return (_restAdapter);
}
},
lookupFactory: function() { }
}
});
}