AFFiNE/packages/data-center/tests/utils.ts
2023-01-03 22:45:48 +08:00

10 lines
307 B
TypeScript

import { Signal } from '@blocksuite/store';
export const getDataCenter = async () => {
const dataCenter = await import('../src/index.js');
return await dataCenter.getDataCenter(false);
};
export const waitOnce = <T>(signal: Signal<T>) =>
new Promise<T>(resolve => signal.once(val => resolve(val)));