Skip to content

Commit

Permalink
fix(types): add enumerable model listing to store.resolve() method
Browse files Browse the repository at this point in the history
  • Loading branch information
smalluban committed Oct 30, 2024
1 parent 1574717 commit dd20611
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/types/store/direct-methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ const EnumerableModelPromise: Promise<IEnumerable> =
store.resolve(EnumerableStore);
const EnumerableModel = await EnumerableModelPromise;

const EnumerableModelListPromise: Promise<IEnumerable[]> = store.resolve([
EnumerableStore,
]);
const EnumerableModelList = await EnumerableModelListPromise;

store.get(SingletonStore);
store.get([SingletonStore]);

Expand Down
4 changes: 4 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ export namespace store {
model: Model<M>,
id?: ModelIdentifier,
): Promise<M>;
function resolve<M extends ModelInstance>(
model: [Model<M>],
id?: ModelIdentifier,
): Promise<M[]>;

function ref<T>(fn: () => T): () => T;

Expand Down

0 comments on commit dd20611

Please sign in to comment.