Skip to content

Commit

Permalink
fix(createGlobalState): 类型重载
Browse files Browse the repository at this point in the history
  • Loading branch information
fjc0k committed Jan 19, 2021
1 parent 9c76e5a commit 72e772b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/react/createGlobalState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export interface CreateGlobalStateResult<
watchStateImmediate(callback: (nextState: S, prevState: S) => any): () => void
}

export function createGlobalState<S extends CreateGlobalStateState, R = never>(
initialState: S,
): CreateGlobalStateResult<S, R>

export function createGlobalState<S extends CreateGlobalStateState, R = never>(
customResult?: CreateGlobalStateCustomResult<S, R>,
): CreateGlobalStateResult<S | undefined, R>
Expand Down

0 comments on commit 72e772b

Please sign in to comment.