mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Make DatasetStore the collision-free id authority
This commit is contained in:
@@ -11,7 +11,9 @@ const T = new Date('2026-06-01T00:00:00Z');
|
||||
function seedDataset(name: string, data: unknown): number {
|
||||
const ds = createDataset({ name, data, format: 'json', source: 'inline', now: T });
|
||||
useDatasetStore.getState().add(ds);
|
||||
return ds.id;
|
||||
// `add` is the id authority and reassigns a collision-free id, so read it back
|
||||
// rather than trusting the pre-add createDataset default.
|
||||
return useDatasetStore.getState().datasets[0].id;
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
Reference in New Issue
Block a user