Skip to content

Commit

Permalink
fix(devtools): don't show jsdoc deprecation warning when no options a…
Browse files Browse the repository at this point in the history
…re passed (pmndrs#781)
  • Loading branch information
devanshj authored Feb 9, 2022
1 parent 0ba3c24 commit 1b2560f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/middleware/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,22 @@ export type StoreApiWithDevtools<T extends State> = StoreApi<T> & {
devtools?: DevtoolsType
}

export function devtools<
S extends State,
CustomSetState extends SetState<S>,
CustomGetState extends GetState<S>,
CustomStoreApi extends StoreApi<S>
>(
fn: (set: NamedSet<S>, get: CustomGetState, api: CustomStoreApi) => S
): (
set: CustomSetState,
get: CustomGetState,
api: CustomStoreApi &
StoreApiWithDevtools<S> & {
dispatch?: unknown
dispatchFromDevtools?: boolean
}
) => S
/**
* @deprecated Passing `name` as directly will be not allowed in next major.
* Pass the `name` in an object `{ name: ... }` instead
Expand Down

0 comments on commit 1b2560f

Please sign in to comment.