Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init states #81

Merged
merged 6 commits into from
Apr 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
add note about limit
  • Loading branch information
charkour committed Apr 23, 2023
commit b8527b96dc87edd9aab7298339a96336c0fc81bd
2 changes: 2 additions & 0 deletions packages/zundo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ const withTemporal = temporal<MyState>(

You can initialize the temporal store with past and future states. This is useful when you want to load a previous state from a database or initialize the store with a default state. By default, the temporal store is initialized with an empty array of past and future states.

> Note: The `pastStates` and `futureStates` do not respect the limit set in the options. If you want to limit the number of past and future states, you must do so manually prior to initializing the store.

```tsx
const withTemporal = temporal<MyState>(
(set) => ({ ... }),
Expand Down