Skip to content

Commit

Permalink
Add getInitialState as part of api utilities (#2729)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbritto-dev authored Sep 10, 2024
1 parent 0a4f9d0 commit 5ebe860
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/apis/create-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ createStore<T>()(stateCreatorFn: StateCreator<T, [], []>): StoreApi<T>

#### Returns

`createStore` returns a vanilla store that exposes API utilities, `setState`, `getState` and
`subscribe`.
`createStore` returns a vanilla store that exposes API utilities, `setState`, `getState`,
`getInitialState` and `subscribe`.

## Usage

Expand Down
8 changes: 4 additions & 4 deletions docs/apis/create-with-equality-fn.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ createWithEqualityFn<T>()(stateCreatorFn: StateCreator<T, [], []>, equalityFn?:

#### Returns

`createWithEqualityFn` returns a React Hook with some API utilities, `setState`, `getState`, and
`subscribe`, attached like `create`. It lets you return data that is based on current state,
using a selector function, and lets you skip re-renders using an equality function. It should take
a selector function, and an equality function as arguments.
`createWithEqualityFn` returns a React Hook with API utilities attached, just like `create`. It
lets you return data that is based on current state, using a selector function, and lets you skip
re-renders using an equality function. It should take a selector function, and an equality function
as arguments.

### Updating state based on previous state

Expand Down
6 changes: 3 additions & 3 deletions docs/apis/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ create<T>()(stateCreatorFn: StateCreator<T, [], []>): UseBoundStore<StoreApi<T>>

#### Returns

`create` returns a React Hook with some API utilities, `setState`, `getState`, and `subscribe`,
attached. It lets you return data that is based on current state, using a selector function. It
should take a selector function as its only argument.
`create` returns a React Hook with API utilities, `setState`, `getState`, `getInitialState` and
`subscribe`, attached. It lets you return data that is based on current state, using a selector
function. It should take a selector function as its only argument.

## Usage

Expand Down

0 comments on commit 5ebe860

Please sign in to comment.