mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 12:55:00 +00:00
feat(nbstore): adapt op pattern (#8808)
This commit is contained in:
19
packages/common/nbstore/src/impls/index.ts
Normal file
19
packages/common/nbstore/src/impls/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { Storage } from '../storage';
|
||||
|
||||
type StorageConstructor = new (...args: any[]) => Storage;
|
||||
|
||||
export const storages: StorageConstructor[] = [];
|
||||
|
||||
// in next pr
|
||||
// eslint-disable-next-line sonarjs/no-empty-collection
|
||||
const AvailableStorageImplementations = storages.reduce(
|
||||
(acc, curr) => {
|
||||
acc[curr.name] = curr;
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, StorageConstructor>
|
||||
);
|
||||
|
||||
export const getAvailableStorageImplementations = (name: string) => {
|
||||
return AvailableStorageImplementations[name];
|
||||
};
|
||||
Reference in New Issue
Block a user