AFFiNE/packages/data-center/tests/utils.ts

10 lines
307 B
TypeScript
Raw Normal View History

2023-01-03 17:43:04 +03:00
import { Signal } from '@blocksuite/store';
2023-01-03 17:45:48 +03:00
export const getDataCenter = async () => {
const dataCenter = await import('../src/index.js');
return await dataCenter.getDataCenter(false);
2023-01-02 14:55:38 +03:00
};
2023-01-03 17:43:04 +03:00
export const waitOnce = <T>(signal: Signal<T>) =>
new Promise<T>(resolve => signal.once(val => resolve(val)));