open-nomad/ui/tests/utils/push-payload-to-store.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
420 B
JavaScript
Raw Normal View History

2018-02-20 20:04:36 +00:00
import { run } from '@ember/runloop';
// These are private store methods called by store "finder" methods.
// Useful in unit tests when there is store interaction, since calling
// adapter and serializer methods directly will never insert data into
// the store.
export default function pushPayloadToStore(store, payload, modelName) {
run(() => {
store._push(payload);
store._didUpdateAll(modelName);
});
}