Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dbritto-dev committed Apr 13, 2024
1 parent fbdb9ed commit 9906857
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"editor.defaultFormatter": "biomejs.biome"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zustand-injectors",
"description": "A sweet way of lazy load slices",
"version": "0.0.1",
"version": "0.0.2",
"author": "Danilo Britto",
"repository": {
"type": "git",
Expand Down
15 changes: 5 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import type { StateCreator, StoreMutatorIdentifier } from "zustand/vanilla";
type StoreInjectors<S> = {
asyncSliceInitializers: Record<
string,
// biome-ignore lint/suspicious/noExplicitAny: any can be any slice
() => Promise<StateCreator<S, [], [], any>>
() => Promise<StateCreator<S, [], [], unknown>>
>;
injectAsyncSliceInitializer: (
key: string,
// biome-ignore lint/suspicious/noExplicitAny: any can be any slice
asyncSliceInitializer: () => Promise<StateCreator<S, [], [], any>>,
asyncSliceInitializer: () => Promise<StateCreator<S, [], [], unknown>>,
) => void;
};

Expand All @@ -22,8 +20,7 @@ type Injectors = <
initializer: StateCreator<T, [...Mps, ["injectors", never]], Mcs>,
initialAsyncSliceInitializers?: Record<
string,
// biome-ignore lint/suspicious/noExplicitAny: any can be any slice
() => Promise<StateCreator<T, [], [], any>>
() => Promise<StateCreator<T, [], [], unknown>>
>,
) => StateCreator<T, Mps, [["injectors", U], ...Mcs]>;

Expand All @@ -37,8 +34,7 @@ type InjectorsImpl = <T>(
storeInitializer: StateCreator<T, [], []>,
initialSliceInitializers?: Record<
string,
// biome-ignore lint/suspicious/noExplicitAny: any can be any slice
() => Promise<StateCreator<T, [], [], any>>
() => Promise<StateCreator<T, [], [], unknown>>
>,
) => StateCreator<T, [], []>;

Expand All @@ -50,8 +46,7 @@ declare module "zustand/vanilla" {
}

const injectAsyncSliceInitializers = async <T>(
// biome-ignore lint/suspicious/noExplicitAny: any can be any slice
...args: Parameters<StateCreator<T, [["injectors", T]], [], any>>
...args: Parameters<StateCreator<T, [["injectors", T]], [], unknown>>
): Promise<void> => {
const [, , store] = args;

Expand Down

0 comments on commit 9906857

Please sign in to comment.