mirror of
https://github.com/directus/directus.git
synced 2026-02-03 13:05:09 -05:00
* 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
16 lines
338 B
TypeScript
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;
|
|
}
|