Files
directus/src/hydrate.ts
Rijk van Zanten 28531b531b Add hydration, collection store, collections module navigation (#125)
* Add hydration functions and logout route

* Add tests for hydration

* Add collections nav

* Structure collections module, add overview route

* Fix failing tests

* Add test for use-navigation

* Add tests for collections-navigation

* Add tests for collections-overview

* Fix export for use-navigation composition

* Update tests
2020-02-28 16:21:51 -05:00

16 lines
338 B
TypeScript

import { useCollectionsStore } from '@/stores/collections';
export let hydrated = false;
export async function hydrate() {
if (hydrated) return;
await useCollectionsStore().getCollections();
hydrated = true;
}
export async function dehydrate() {
if (hydrated === false) return;
useCollectionsStore().reset();
hydrated = false;
}