diff --git a/docs/community/docs-contributors.md b/docs/community/docs-contributors.md new file mode 100644 index 000000000..1796fddf5 --- /dev/null +++ b/docs/community/docs-contributors.md @@ -0,0 +1,5 @@ +--- +title: Docs Contributors +description: +nav: 301 +--- diff --git a/docs/community/third-party-libraries.md b/docs/community/third-party-libraries.md new file mode 100644 index 000000000..752550f3e --- /dev/null +++ b/docs/community/third-party-libraries.md @@ -0,0 +1,5 @@ +--- +title: Third-party Libraries +description: +nav: 302 +--- diff --git a/docs/community/versioning-policy.md b/docs/community/versioning-policy.md new file mode 100644 index 000000000..235b12443 --- /dev/null +++ b/docs/community/versioning-policy.md @@ -0,0 +1,5 @@ +--- +title: Versioning Policy +description: +nav: 303 +--- diff --git a/docs/community/zustand-videos.md b/docs/community/zustand-videos.md new file mode 100644 index 000000000..fc6ca3829 --- /dev/null +++ b/docs/community/zustand-videos.md @@ -0,0 +1,5 @@ +--- +title: Zustand Videos +description: +nav: 300 +--- diff --git a/docs/learn/async-data-and-data-fetching.md b/docs/learn/async-data-and-data-fetching.md new file mode 100644 index 000000000..961d31cb1 --- /dev/null +++ b/docs/learn/async-data-and-data-fetching.md @@ -0,0 +1,5 @@ +--- +title: Async Data and Data Fetching +description: +nav: 106 +--- diff --git a/docs/learn/choosing-the-state-structure.md b/docs/learn/choosing-the-state-structure.md new file mode 100644 index 000000000..4fdc80941 --- /dev/null +++ b/docs/learn/choosing-the-state-structure.md @@ -0,0 +1,5 @@ +--- +title: Choosing the State Structure +description: One store, multiple stores, and multiple slices +nav: 104 +--- diff --git a/docs/learn/colocation-actions.md b/docs/learn/colocation-actions.md new file mode 100644 index 000000000..8709eb6d1 --- /dev/null +++ b/docs/learn/colocation-actions.md @@ -0,0 +1,5 @@ +--- +title: Colocating Actions +description: +nav: 105 +--- diff --git a/docs/learn/extracting-state-logic-into-a-reducer-with-redux-and-devtools-middlewares.md b/docs/learn/extracting-state-logic-into-a-reducer-with-redux-and-devtools-middlewares.md new file mode 100644 index 000000000..7c6040de9 --- /dev/null +++ b/docs/learn/extracting-state-logic-into-a-reducer-with-redux-and-devtools-middlewares.md @@ -0,0 +1,5 @@ +--- +title: Extracting State Logic into a Reducer with Redux and Devtools Middlewares +description: +nav: 112 +--- diff --git a/docs/learn/isolating-state-between-components.md b/docs/learn/isolating-state-between-components.md new file mode 100644 index 000000000..a60565507 --- /dev/null +++ b/docs/learn/isolating-state-between-components.md @@ -0,0 +1,5 @@ +--- +title: Isolating State Between Components +description: +nav: 108 +--- diff --git a/docs/learn/listening-to-selected-data-with-subscribe-with-selector-middleware.md b/docs/learn/listening-to-selected-data-with-subscribe-with-selector-middleware.md new file mode 100644 index 000000000..e331b95fb --- /dev/null +++ b/docs/learn/listening-to-selected-data-with-subscribe-with-selector-middleware.md @@ -0,0 +1,5 @@ +--- +title: Listening to Selected Data with SubscribeWithSelector Middleware +description: +nav: 113 +--- diff --git a/docs/learn/middleware-use-cases.md b/docs/learn/middleware-use-cases.md new file mode 100644 index 000000000..9c56b266d --- /dev/null +++ b/docs/learn/middleware-use-cases.md @@ -0,0 +1,5 @@ +--- +title: Middleware Use Cases +description: +nav: 114 +--- diff --git a/docs/learn/nextjs.md b/docs/learn/nextjs.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/learn/persisting-state-with-persist-middleware.md b/docs/learn/persisting-state-with-persist-middleware.md new file mode 100644 index 000000000..d14aeb585 --- /dev/null +++ b/docs/learn/persisting-state-with-persist-middleware.md @@ -0,0 +1,5 @@ +--- +title: Persisting State with Persist Middleware +description: +nav: 111 +--- diff --git a/docs/learn/selecting-data-and-preventing-re-renders-with-selectors-and-equality-function.md b/docs/learn/selecting-data-and-preventing-re-renders-with-selectors-and-equality-function.md new file mode 100644 index 000000000..efd54520c --- /dev/null +++ b/docs/learn/selecting-data-and-preventing-re-renders-with-selectors-and-equality-function.md @@ -0,0 +1,5 @@ +--- +title: Selecting Data and Preventing Re-renders with selectors and equality function +description: +nav: 107 +--- diff --git a/docs/learn/start-new-project.md b/docs/learn/start-new-project.md new file mode 100644 index 000000000..8459b3820 --- /dev/null +++ b/docs/learn/start-new-project.md @@ -0,0 +1,5 @@ +--- +title: Start a new project +description: Vanilla, React, and React Native +nav: 102 +--- diff --git a/docs/learn/testing.md b/docs/learn/testing.md new file mode 100644 index 000000000..e69de29bb diff --git a/docs/learn/thinking-in-zustand.md b/docs/learn/thinking-in-zustand.md new file mode 100644 index 000000000..19e787528 --- /dev/null +++ b/docs/learn/thinking-in-zustand.md @@ -0,0 +1,5 @@ +--- +title: Thinking in Zustand +description: Motivation, principles, and glossary +nav: 101 +--- diff --git a/docs/learn/tutorial-tic-tac-toe.md b/docs/learn/tutorial-tic-tac-toe.md new file mode 100644 index 000000000..a9593f6c2 --- /dev/null +++ b/docs/learn/tutorial-tic-tac-toe.md @@ -0,0 +1,5 @@ +--- +title: 'Tutorial: Tic-Tac-Toe' +description: +nav: 100 +--- diff --git a/docs/learn/using-middlewares.md b/docs/learn/using-middlewares.md new file mode 100644 index 000000000..b5743afd1 --- /dev/null +++ b/docs/learn/using-middlewares.md @@ -0,0 +1,5 @@ +--- +title: Using Middlewares +description: +nav: 109 +--- diff --git a/docs/learn/using-typescript.md b/docs/learn/using-typescript.md new file mode 100644 index 000000000..6becc5232 --- /dev/null +++ b/docs/learn/using-typescript.md @@ -0,0 +1,5 @@ +--- +title: Using TypeScript +description: +nav: 103 +--- diff --git a/docs/learn/writing-immutable-update-with-immer-middleware.md b/docs/learn/writing-immutable-update-with-immer-middleware.md new file mode 100644 index 000000000..6ea0daf4e --- /dev/null +++ b/docs/learn/writing-immutable-update-with-immer-middleware.md @@ -0,0 +1,5 @@ +--- +title: Writing Immutable Updates with Immer Middleware +description: +nav: 110 +--- diff --git a/docs/reference/combine.md b/docs/reference/combine.md new file mode 100644 index 000000000..631022b6e --- /dev/null +++ b/docs/reference/combine.md @@ -0,0 +1,98 @@ +--- +title: combine +description: +nav: 201 +--- + +# combine + +`combine` middleware lets you create a new state by combining an initial state with additional +state created by a function. This middleware is particularly useful due to infers the state, so you +don't need to type it. + +```js +combine(initialState, additionalStateCreator) +``` + +- [Reference](#reference) + - [Signature](#combine-signature) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `combine` Signature + +```ts +combine(initialState: T, additionalStateCreatorFn: StateCreator): StateCreator & U, [], []> +``` + +#### Parameters + +- `initialState`: The value you want the state to be initially. It can be a value of any type, + except a function. +- `additionalStateCreatorFn`: The state creator function that specifies how the state gets + initialized and updated. It must be pure, should take `setState` function, `getState` function + and `storeApi` as arguments. + +#### Returns + +`combine` returns a state creator function. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether to replace the entire state or merge the + update with the current state. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state and +previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe. + +### `storeApi` + +The `storeApi` lets you access to the store API functions like +[`setState` function](#setstate-function), [`getState` function](#getstate-function), and +[`subscribe` function](#subscribe-function). + +## Usage + +## Troubleshooting diff --git a/docs/reference/core-concepts.md b/docs/reference/core-concepts.md new file mode 100644 index 000000000..26111bb36 --- /dev/null +++ b/docs/reference/core-concepts.md @@ -0,0 +1,71 @@ +--- +title: Core Concepts +description: +nav: 200 +--- + +# Core Concepts + +## Store + +The Store lets you access to the store API utilities. + +## API Utilities + +These store API utilities are: `setState` function, `getState` function, and `subscribe` function. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether the state is completely replaced or only + shallow updated, through a shallow merge. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### Selector + +Lorem, ipsum dolor sit amet consectetur adipisicing elit. Vel veritatis alias saepe vitae placeat +blanditiis laborum, asperiores architecto explicabo unde. Cum sint vero veritatis. Hic ipsum quis +saepe voluptates temporibus! + +### Bound Hook + +Lorem, ipsum dolor sit amet consectetur adipisicing elit. Minus quas sequi, similique corrupti iure +incidunt autem. Voluptas eum atque harum! Assumenda natus, animi doloribus facilis maiores dicta +iusto ipsa earum. diff --git a/docs/reference/create-store.md b/docs/reference/create-store.md new file mode 100644 index 000000000..bf8e437bc --- /dev/null +++ b/docs/reference/create-store.md @@ -0,0 +1,134 @@ +--- +title: createStore +description: +nav: 202 +--- + +# createStore + +`createStore` lets you create a vanilla store with store API utilities. In React, you can utilize a +vanilla store using the [`useStore`](./use-store) hook. + +```js +createStore(initializer) +``` + +- [Reference](#reference) + - [Signature](#createstore-signature) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) + - [Updating state based on previous state](#updating-state-base-on-a-previous-state) + - [Updating objects and non-objects in state](#updating-objects-and-non-objects-in-state) + - [Subscribing to state updates](#subscribing-to-state-updates) + - [Split state in multiple slices](#split-state-in-multiple-slices) +- [Troubleshooting](#troubleshooting) + - [I’ve updated the state, but the screen doesn’t update](#ive-updated-the-state-but-the-screen-doesnt-update) + +## Reference + +### `createStore` Signature + +```ts +createStore()(stateCreatorFn: StateCreator): StoreApi +``` + +#### Parameters + +- `stateCreatorFn`: The value you want the state to be initially. It can be a value of any type, but + when you pass a function should take `setState` function, `getState` function and `storeApi` as + arguments. + +#### Returns + +`createStore` returns a vanilla store with some API utilities. These API utilities are: `setState` +function, `getState` function, and `subscribe` function. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether the state is completely replaced or only + shallow updated, through a shallow merge. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +`setState` function, `getState` function, and `subscribe` function. + +## Usage + +### Updating state base on a previous state + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Nam in provident eius eaque modi, +architecto consequuntur nihil soluta, dolore ratione, deleniti voluptatum unde. Qui veritatis, +deleniti error vero ducimus sunt. + +### Updating objects and non-objects in state + +Lorem, ipsum dolor sit amet consectetur adipisicing elit. Cupiditate consectetur sequi repellendus +culpa nesciunt dolores aut. Voluptas corrupti expedita temporibus doloribus, maxime dolor iure +suscipit adipisci hic cumque quasi officia? + +### Subscribing to state updates + +Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aut quidem est neque consequuntur, +dolorem eius, explicabo ullam voluptatibus ex corporis qui, quasi eum reprehenderit maxime! Magni +magnam dignissimos eos dicta! + +### Split state in multiple slices + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Repellat, sint doloremque incidunt beatae +asperiores tempore amet quam ipsa commodi adipisci nobis quis fugiat aliquam? Facere repellendus +asperiores incidunt maxime facilis? + +## Troubleshooting + +Lorem, ipsum dolor sit amet consectetur adipisicing elit. Aut illo, earum beatae voluptate corporis +saepe ipsa? Placeat animi commodi qui odit debitis eveniet enim maiores, illum tempora repellendus +sint non? + +### I’ve updated the state, but the screen doesn’t update + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi facere vel minus saepe inventore hic +tenetur aspernatur officia ipsam accusantium illum, neque consectetur placeat doloremque pariatur +voluptatum amet odio quos! diff --git a/docs/reference/create-with-equality-fn.md b/docs/reference/create-with-equality-fn.md new file mode 100644 index 000000000..e4aa65412 --- /dev/null +++ b/docs/reference/create-with-equality-fn.md @@ -0,0 +1,116 @@ +--- +title: createWithEqualityFn +description: +nav: 203 +--- + +# createWithEqualityFn ⚛️ + +`createWithEqualityFn` lets you create a React Hook with store API utilities, and default equality +function. + +```js +createWithEqualityFn(stateCreatorFn, equalityFn) +``` + +- [Reference](#reference) + - [Signature](#createwithequalityfn-signature) + - [`selector` function](#selector-function) + - [`equality` function](#equality-function) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) + - [Updating state based on previous state](#updating-state-base-on-a-previous-state) + - [Updating objects and non-objects in state](#updating-objects-and-non-objects-in-state) + - [Subscribing to state updates](#subscribing-to-state-updates) +- [Troubleshooting](#troubleshooting) + - [I’ve updated the state, but the screen doesn’t update](#ive-updated-the-state-but-the-screen-doesnt-update) + +## Reference + +### `createWithEqualityFn` Signature + +```ts +createWithEqualityFn()(stateCreatorFn: StateCreator, equalityFn?: (a: T, b: T) => boolean): UseBoundStore> +``` + +#### Parameters + +- `stateCreatorFn`: The state creator function that specifies how the state gets initialized and + updated. It must be pure, should take `setState` function, `getState` function and `storeApi` as + arguments. +- **optional** `equalityFn`: Defaults to `Object.is`. A function that lets you skip re-renders. + +#### Returns + +`createWithEqualityFn` returns a React Hook: + +1. The React Hook that lets you return data that is based on current state, using a `selector` + function, and lets you skip re-renders using a `equality` function. It should take a selector + function, and an equality function as arguments. + +### `selector` function + +The `selector` function lets you return data that is based on current state. It should take current +state as its only argument. + +### `equality` function + +The `equality` function lets you skip re-renders when certain values are unchanged. It should +take the previous state, and its current state as arguments. It should return `true` if the +previous and current states are equal. Otherwise, it should return `false`. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether to replace the entire state or merge the + update with the current state. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +`setState` function, `getState` function, and `subscribe` function. + +## Usage + +## Troubleshooting diff --git a/docs/reference/create.md b/docs/reference/create.md new file mode 100644 index 000000000..ddbfba18a --- /dev/null +++ b/docs/reference/create.md @@ -0,0 +1,132 @@ +--- +title: create +description: +nav: 204 +--- + +# create ⚛️ + +`create` lets you create a React Hook with store API utilities. + +```js +create(stateCreatorFn) +``` + +- [Reference](#reference) + - [Signature](#create-signature) + - [`selector` function](#selector-function) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) + - [Updating state based on previous state](#updating-state-base-on-a-previous-state) + - [Updating objects and non-objects in state](#updating-objects-and-non-objects-in-state) + - [Subscribing to state updates](#subscribing-to-state-updates) +- [Troubleshooting](#troubleshooting) + - [I’ve updated the state, but the screen doesn’t update](#ive-updated-the-state-but-the-screen-doesnt-update) + +## Reference + +### `create` Signature + +```ts +create()(stateCreatorFn: StateCreator): UseBoundStore> +``` + +#### Parameters + +- `stateCreatorFn`: The value you want the state to be initially. It can be a value of any type, + but when you pass a function should take `setState` function, `getState` function and `storeApi` + as arguments. + +#### Returns + +`create` returns a React Hook with Store API attached: + +1. The React Hook that lets you return data that is based on current state, using a + [`selector` function](#selector-function). It should take a selector function as its only + argument. + +### `selector` function + +The `selector` function lets you return data that is based on current state. It should take current +state as its only argument. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether the state is completely replaced or only + shallow updated, through a shallow merge. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +[`setState` function](#setstate-function), [`getState` function](#getstate-function), and +[`subscribe` function](#subscribe-function). + +## Usage + +### Updating state base on previous state + +Lorem ipsum, dolor sit amet consectetur adipisicing elit. Incidunt placeat debitis laborum vero +totam excepturi, ducimus, qui molestias, dolorem minus doloribus repudiandae ex delectus corporis +libero quo et numquam quidem? + +### Updating objects and non-objects in state + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Maxime, quo expedita! Rem aut placeat +excepturi accusamus deserunt velit reprehenderit corrupti amet ad nisi ipsum, veritatis +perspiciatis eligendi possimus quasi facilis! + +### Subscribing to state updates + +Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ipsa minima cum consectetur magnam, +nostrum temporibus. Exercitationem enim temporibus ipsum doloremque sequi fuga aliquid rem quasi +harum, eos, eaque est ducimus! + +## Troubleshooting + +### I’ve updated the state, but the screen doesn’t update + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur repudiandae consequuntur +aliquam iste corporis inventore vel dolorum architecto qui error. Et enim voluptate voluptatem +animi, aut quas commodi corporis fugiat. diff --git a/docs/reference/devtools.md b/docs/reference/devtools.md new file mode 100644 index 000000000..cadbb9f61 --- /dev/null +++ b/docs/reference/devtools.md @@ -0,0 +1,63 @@ +--- +title: devtools +description: +nav: 205 +--- + +# devtools + +`devtools` middleware lets you use [Redux DevTools Extension](https://github.com/zalmoxisus/redux-devtools-extension) +without Redux. Read more about the benefits of using [Redux DevTools for debugging](https://redux.js.org/style-guide/#use-the-redux-devtools-extension-for-debugging). + +```js +devtools(stateCreatorFn, devtoolsOptions) +``` + +- [Reference](#reference) + - [Signature](#devtools-signature) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + - [Only one store is displayed](#only-one-store-is-displayed) + - [Action names are labeled as 'anonymous'](#all-action-names-are-labeled-as-anonymous) + +## Reference + +### `devtools` Signature + +```ts +devtools(stateCreatorFn: StateCreator, devtoolsOptions?: DevtoolsOptions): StateCreator +``` + +#### Parameters + +- `stateCreatorFn`: The state creator function that specifies how the state gets initialized and + updated. It must be pure, should take `setState` function, `getState` function and `storeApi` as + arguments. +- **optional** `devtoolsOptions`: An object to define Redux DevTools options. + - **optional** `name`: A custom identifier for the connection in the Redux DevTools. + - **optional** `enabled`: Defaults to `true` when is on development mode, and defaults to `false` + when is on production mode. Enables or disables the Redux DevTools integration + for this store. + - **optional** `anonymousActionType`: Defaults to `anonymous`. A string to use as the action type + for anonymous mutations in the Redux DevTools. + - **optional** `store`: A custom identifier for the store in the Redux DevTools. + +#### Returns + +`devtools` returns a state creator function. + +## Usage + +## Troubleshooting + +### Only one store is displayed + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Illo voluptatum, eos suscipit explicabo +animi ad porro vitae vel ullam saepe magnam in facilis earum, nulla officia sit. Unde, nostrum +delectus! + +### All action names are labeled as 'anonymous' + +Lorem ipsum dolor sit, amet consectetur adipisicing elit. Placeat et illo hic architecto deleniti +soluta, veritatis reiciendis nesciunt laborum laudantium, dolorum asperiores fuga at accusamus aut +facere ex perspiciatis qui! diff --git a/docs/reference/immer.md b/docs/reference/immer.md new file mode 100644 index 000000000..b99c1facb --- /dev/null +++ b/docs/reference/immer.md @@ -0,0 +1,93 @@ +--- +title: immer +description: +nav: 206 +--- + +# immer + +`immer` middleware lets you perform immutable updates. + +```js +immer(stateCreatorFn) +``` + +- [Reference](#reference) + - [Signature](#immer-signature) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `immer` Signature + +```ts +immer(stateCreatorFn: StateCreator): StateCreator +``` + +#### Parameters + +- `stateCreatorFn`: The state creator function that specifies how the state gets initialized and + updated. It must be pure, should take `setState` function, `getState` function and `storeApi` as + arguments. + +#### Returns + +`immer` returns a state creator function. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether the state is completely replaced or only + shallow updated, through a shallow merge. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +`setState` function, `getState` function, and `subscribe` function. + +## Usage + +## Troubleshooting diff --git a/docs/reference/persist.md b/docs/reference/persist.md new file mode 100644 index 000000000..9600d414e --- /dev/null +++ b/docs/reference/persist.md @@ -0,0 +1,72 @@ +--- +title: persist Middleware +description: +nav: 207 +--- + +# persist + +`persist` middleware lets you persist your store's state across page reloads or application +restarts. + +```js +persist(stateCreatorFn, persistOptions) +``` + +- [Reference](#reference) + - [Signature](#persist-signature) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + - [Cannot read property `setOptions` of undefined](#cannot-read-property-setoptions-of-undefined) + - [Storage is not being validated or type checked](#storage-is-not-being-validated-or-type-checked) + - [Cannot read property `setItem`/`getItem`/`removeItem` of null](#cannot-read-property-setitemgetitemremoveitem-of-null) + +## Reference + +### `persist` Signature + +```ts +persist(stateCreatorFn: StateCreator, persistOptions?: PersistOptions): StateCreator +``` + +#### Parameters + +- `stateCreatorFn`: The state creator function that specifies how the state gets initialized and + updated. It must be pure, should take `setState` function, `getState` function and `storeApi` as + arguments. +- `persistOptions`: An object to. + - `name`: A unique name of the item for your store in the storage. + - **optional** `storage`: Defaults to `createJSONStorage(() => localStorage)`. - + - **optional** `partialize`: A function to filter state fields before persisting it. + - **optional** `onRehydrateStorage`: A function or function returning a function that allows + custom logic before and after state rehydration. + - **optional** `version`: A version number for the persisted state. If the stored state version + doesn't match, it won't be used. + - **optional** `migrate`: A function to migrate persisted state if the version mismatch occurs. + - **optional** `merge`: A function for custom logic when merging persisted state with the current + state during rehydration. Defaults to a shallow merge. + - **optional** `skipHydration`: Defaults to `false`. If `true`, the middleware won't + automatically rehydrate the state on initialization. Use `rehydrate` function manually in this + case. This is useful for server-side rendering (SSR) applications. + +#### Returns + +`persist` returns a state creator function. + +## Usage + +## Troubleshooting + +### Cannot read property `setOptions` of undefined + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum reprehenderit eaque excepturi, +cumque officia incidunt repellendus, fugit soluta dolore perspiciatis laudantium voluptatem +repudiandae illum ipsum quam, perferendis iusto a aperiam! + +### Storage is not being validated or type checked + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Harum ratione aspernatur dolores ut in +erferendis quis reprehenderit iure numquam minima laborum vero unde, eum laudantium! Minima beatae +natus tempore est. + +### Cannot read property `setItem`/`getItem`/`removeItem` of null diff --git a/docs/reference/redux.md b/docs/reference/redux.md new file mode 100644 index 000000000..6cd53ce42 --- /dev/null +++ b/docs/reference/redux.md @@ -0,0 +1,94 @@ +--- +title: redux +description: +nav: 208 +--- + +# redux + +`redux` middleware lets you inspect and debug your state from within the browser, using the redux +devtools browser extension. + +```js +redux(reducer, initialState) +``` + +- [Reference](#reference) + - [Signature](#redux-signature) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `redux` Signature + +```ts +redux(reducer: (state: T, action: A) => T, initialState: T): StateCreator A }, [], []> +``` + +#### Parameters + +- `reducer`: It should be pure and should take the current state of your application and an action + object as arguments, and returns the new state resulting from applying the action. +- `initialState`: It should be the initial state of your application data managed by the store. + +#### Returns + +`redux` returns a state creator function. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether the state is completely replaced or only + shallow updated, through a shallow merge. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +`setState` function, `getState` function, and `subscribe` function. + +## Usage + +## Troubleshooting diff --git a/docs/reference/shallow.md b/docs/reference/shallow.md new file mode 100644 index 000000000..f292f36f1 --- /dev/null +++ b/docs/reference/shallow.md @@ -0,0 +1,66 @@ +--- +title: shallow +description: +nav: 209 +--- + +# shallow + +`shallow` is a comparison function that lets you optimize re-renders when it's used as a custom +equality function. + +```js +shallow(a, b) +``` + +- [Reference](#reference) + - [Signature](#shallow-signature) +- [Usage](#usage) + - [Skipping re-rendering when props are unchanged](#skipping-re-rendering-when-props-are-unchanged) + - [Specifying a custom comparison function for 'memo'](#specifying-a-custom-comparison-function-for-memo) +- [Troubleshooting](#troubleshooting) + - [My component re-renders](#my-component-re-renders) + +## Reference + +### `shallow` Signature + +```ts +shallow(a: T, b: T): boolean +``` + +#### Parameters + +- `a`: The first value. +- `b`: The second value. + +#### Returns + +`shallow` returns `true` when `a` and `b` are equal based on a shallow comparison of their +**top-level** properties. Otherwise, it should return `false`. + +## Usage + +### Skipping re-rendering when props are unchanged + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Sed saepe nam reiciendis dignissimos +recusandae rem perspiciatis distinctio, dolor minus obcaecati expedita quis sunt nulla aliquam eius +quos iusto! Facere, molestiae! + +### Specifying a custom comparison function for 'memo' + +Lorem ipsum, dolor sit amet consectetur adipisicing elit. Culpa ullam, excepturi ipsam corporis +soluta placeat eum nam veritatis, quisquam quam necessitatibus similique porro sint possimus cum +obcaecati laboriosam sapiente provident. + +## Troubleshooting + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas explicabo delectus necessitatibus +molestias ex distinctio corporis, ad, expedita qui quia corrupti quos fuga eaque! Adipisci dolore +minus omnis neque provident. + +### My component re-renders + +Lorem ipsum dolor sit amet consectetur adipisicing elit. Doloribus nobis nisi dolore necessitatibus +perspiciatis, iure consequatur mollitia cupiditate iste possimus suscipit a, harum fugiat officiis +aliquid explicabo. Expedita, architecto suscipit? diff --git a/docs/reference/subscribe-with-selector.md b/docs/reference/subscribe-with-selector.md new file mode 100644 index 000000000..7884684eb --- /dev/null +++ b/docs/reference/subscribe-with-selector.md @@ -0,0 +1,93 @@ +--- +title: subscribeWithSelector +description: +nav: 210 +--- + +# subscribeWithSelector + +`subscribeWithSelector` middleware lets you subscribe to specific data based on current state. + +```js +subscribeWithSelector(stateCreatorFn) +``` + +- [Reference](#reference) + - [Signature](#subscribewithselector-signature) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `subscribeWithSelector` Signature + +```ts +subscribeWithSelector(stateCreatorFn: StateCreator): StateCreator +``` + +#### Parameters + +- `stateCreatorFn`: The state creator function that specifies how the state gets initialized and + updated. It must be pure, should take `setState` function, `getState` function and `storeApi` as + arguments. + +#### Returns + +`subscribeWithSelector` returns a state creator function. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether the state is completely replaced or only + shallow updated, through a shallow merge. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +`setState` function, `getState` function, and `subscribe` function. + +## Usage + +## Troubleshooting diff --git a/docs/reference/use-shallow.md b/docs/reference/use-shallow.md new file mode 100644 index 000000000..1aaa5e90f --- /dev/null +++ b/docs/reference/use-shallow.md @@ -0,0 +1,45 @@ +--- +title: useShallow +description: +nav: 211 +--- + +# useShallow ⚛️ + +`useShallow` is a React Hook that lets you optimize re-renders. + +```js +useShallow(selector) +``` + +- [Reference](#reference) + - [Signature](#useshallow-signature) + - [`selector` function](#selector-function) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `useShallow` Signature + +```ts +useShallow(selectorFn: (state: T) => U): (state: T) => U +``` + +#### Parameters + +- `selectorFn`: A function that lets you return data that is based on current state. + +#### Returns + +`useShallow` returns a memoized version of a selector function using a shallow comparison for +memoization. + +### `selector` function + +The `selector` function lets you return data that is based on current state. It should take current +state as its only argument. + +## Usage + +## Troubleshooting diff --git a/docs/reference/use-store-with-equality-fn.md b/docs/reference/use-store-with-equality-fn.md new file mode 100644 index 000000000..3ee9d07a5 --- /dev/null +++ b/docs/reference/use-store-with-equality-fn.md @@ -0,0 +1,105 @@ +--- +title: useStoreWithEqualityFn +description: +nav: 212 +--- + +# useStoreWithEqualityFn ⚛️ + +`useStoreWithEqualityFn` is a React Hook lets you Lorem ipsum dolor sit amet, consectetur +adipisicing elit. Tempora voluptatum dolore non, eveniet consequuntur labore, optio saepe hic +asperiores repellendus error alias, facilis ab assumenda possimus magnam voluptate. Blanditiis, +perspiciatis? + +```js +useStoreWithEqualityFn(storeApi, selector, equalityFn) +``` + +- [Reference](#reference) + - [Signature](#usestorewithequalityfn-signature) +- [Usage](#usage) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `useStoreWithEqualityFn` Signature + +```ts +useStoreWithEqualityFn(storeApi: StoreApi, selectorFn: (state: T) => U, equalityFn?: (a: T, b: T) => boolean): U +``` + +#### Parameters + +- `storeApi`: The instance that lets you access to store API utilities. +- `selectorFn`: A function that lets you return data that is based on current state. +- `equalityFn`: A function that lets you skip re-renders. + +#### Returns + +`useStoreWithEqualityFn` returns Lorem ipsum dolor sit amet consectetur adipisicing elit. Sint +ipsam iure nesciunt consectetur magnam nulla nostrum ducimus repellendus. Maiores ducimus, expedita +architecto in placeat enim debitis non repudiandae veritatis neque. + +### `selector` function + +The `selector` function lets you return data that is based on current state. It should take current +state as its only argument. + +### `equality` function + +The `equality` function lets you skip re-renders when certain values are unchanged. It should +take the previous state, and its current state as arguments. It should return `true` if the +previous and current states are equal. Otherwise, it should return `false`. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - If you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - If you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - If you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether to replace the entire state or merge the + update with the current state. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state, and +its previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe from itself. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities. These store API utilities are: +`setState` function, `getState` function, and `subscribe` function. + +## Usage + +## Troubleshooting diff --git a/docs/reference/use-store.md b/docs/reference/use-store.md new file mode 100644 index 000000000..fa0ccc9ac --- /dev/null +++ b/docs/reference/use-store.md @@ -0,0 +1,103 @@ +--- +title: useStore +description: +nav: 213 +--- + +# useStore ⚛️ + +`useStore` is a React Hook that lets you use a vanilla store in React. + +```js +useStore(api, selector) +``` + +- [Reference](#reference) + - [Signature](#usestore-signature) + - [`selector` function](#selector-function) + - [`setState` function](#setstate-function) + - [`getState` function](#getstate-function) + - [`subscribe` function](#subscribe-function) + - [`storeApi`](#storeapi) +- [Usage](#usage) + - [Use a vanilla store in React](#use-a-vanilla-store-in-react) +- [Troubleshooting](#troubleshooting) + +## Reference + +### `useStore` Signature + +```ts +useStore, U = T>(storeApi: StoreApi, selectorFn?: (state: T) => U) => UseBoundStore> +``` + +#### Parameters + +- `storeApi`: The instance that lets you access to store API utilities. +- `selectorFn`: A function that lets you return data that is based on current state. + +#### Returns + +`useStore` returns current state or returns any data based on current state depending on the +selector function. + +### `selector` function + +The `selector` function lets you return data that is based on current state. It should take current +state as its only argument. + +### `setState` function + +The `setState` function lets you update the state to a different value and trigger re-render. You +can pass the next state directly, a next partial state, a function that calculates it from the +previous state, or replace it completely. + +#### Parameters + +- `nextState`: The value that you want the state to be. It can be a value of any type, but there is + a special behavior for functions. + - if you pass an object as a `nextState`. It will shallow merge `nextState` with the current + state. You can pass only the properties you want to update, this allows for selective state + updates without modifying other properties. + - if you pass a non-object as a `nextState`, make sure you use `replace` as `true` to avoid + unexpected behaviors. + - if you pass a function as a `nextState`. It must be pure, should take current state as its + only argument, and should return the next state. The next state returned by the updater + function face the same restrictions of any next state. +- `replace`: This optional boolean flag controls whether to replace the entire state or merge the + update with the current state. + +#### Returns + +`setState` function do not have a return value. + +### `getState` function + +The `getState` function lets you access to the current state. It can be stale on asynchronous +operations. + +### `subscribe` function + +The `subscribe` function lets you subscribe to state updates. It should take current state and +previous state as arguments. + +#### Parameters + +- `currentState`: The current state. +- `previousState`: The previous state. + +#### Returns + +`subscribe` returns a function that lets you unsubscribe. + +### `storeApi` + +The `storeApi` lets you access to the store API utilities like +[`setState` function](#setstate-function), [`getState` function](#getstate-function), +and [`subscribe` function](#subscribe-function). + +## Usage + +### Use a vanilla store in React + +## Troubleshooting diff --git a/docs/getting-started/comparison.md b/old_docs/getting-started/comparison.md similarity index 100% rename from docs/getting-started/comparison.md rename to old_docs/getting-started/comparison.md diff --git a/docs/getting-started/introduction.md b/old_docs/getting-started/introduction.md similarity index 100% rename from docs/getting-started/introduction.md rename to old_docs/getting-started/introduction.md diff --git a/docs/guides/auto-generating-selectors.md b/old_docs/guides/auto-generating-selectors.md similarity index 100% rename from docs/guides/auto-generating-selectors.md rename to old_docs/guides/auto-generating-selectors.md diff --git a/docs/guides/connect-to-state-with-url-hash.md b/old_docs/guides/connect-to-state-with-url-hash.md similarity index 100% rename from docs/guides/connect-to-state-with-url-hash.md rename to old_docs/guides/connect-to-state-with-url-hash.md diff --git a/docs/guides/event-handler-in-pre-react-18.md b/old_docs/guides/event-handler-in-pre-react-18.md similarity index 100% rename from docs/guides/event-handler-in-pre-react-18.md rename to old_docs/guides/event-handler-in-pre-react-18.md diff --git a/docs/guides/flux-inspired-practice.md b/old_docs/guides/flux-inspired-practice.md similarity index 100% rename from docs/guides/flux-inspired-practice.md rename to old_docs/guides/flux-inspired-practice.md diff --git a/docs/guides/how-to-reset-state.md b/old_docs/guides/how-to-reset-state.md similarity index 100% rename from docs/guides/how-to-reset-state.md rename to old_docs/guides/how-to-reset-state.md diff --git a/docs/guides/immutable-state-and-merging.md b/old_docs/guides/immutable-state-and-merging.md similarity index 100% rename from docs/guides/immutable-state-and-merging.md rename to old_docs/guides/immutable-state-and-merging.md diff --git a/docs/guides/initialize-state-with-props.md b/old_docs/guides/initialize-state-with-props.md similarity index 100% rename from docs/guides/initialize-state-with-props.md rename to old_docs/guides/initialize-state-with-props.md diff --git a/docs/guides/maps-and-sets-usage.md b/old_docs/guides/maps-and-sets-usage.md similarity index 100% rename from docs/guides/maps-and-sets-usage.md rename to old_docs/guides/maps-and-sets-usage.md diff --git a/docs/guides/nextjs.md b/old_docs/guides/nextjs.md similarity index 100% rename from docs/guides/nextjs.md rename to old_docs/guides/nextjs.md diff --git a/docs/guides/practice-with-no-store-actions.md b/old_docs/guides/practice-with-no-store-actions.md similarity index 100% rename from docs/guides/practice-with-no-store-actions.md rename to old_docs/guides/practice-with-no-store-actions.md diff --git a/docs/guides/prevent-rerenders-with-use-shallow.md b/old_docs/guides/prevent-rerenders-with-use-shallow.md similarity index 100% rename from docs/guides/prevent-rerenders-with-use-shallow.md rename to old_docs/guides/prevent-rerenders-with-use-shallow.md diff --git a/docs/guides/slices-pattern.md b/old_docs/guides/slices-pattern.md similarity index 100% rename from docs/guides/slices-pattern.md rename to old_docs/guides/slices-pattern.md diff --git a/docs/guides/ssr-and-hydration.md b/old_docs/guides/ssr-and-hydration.md similarity index 100% rename from docs/guides/ssr-and-hydration.md rename to old_docs/guides/ssr-and-hydration.md diff --git a/docs/guides/testing.md b/old_docs/guides/testing.md similarity index 100% rename from docs/guides/testing.md rename to old_docs/guides/testing.md diff --git a/docs/guides/typescript.md b/old_docs/guides/typescript.md similarity index 100% rename from docs/guides/typescript.md rename to old_docs/guides/typescript.md diff --git a/docs/guides/updating-state.md b/old_docs/guides/updating-state.md similarity index 100% rename from docs/guides/updating-state.md rename to old_docs/guides/updating-state.md diff --git a/docs/integrations/immer-middleware.md b/old_docs/integrations/immer-middleware.md similarity index 100% rename from docs/integrations/immer-middleware.md rename to old_docs/integrations/immer-middleware.md diff --git a/docs/integrations/persisting-store-data.md b/old_docs/integrations/persisting-store-data.md similarity index 100% rename from docs/integrations/persisting-store-data.md rename to old_docs/integrations/persisting-store-data.md diff --git a/docs/integrations/third-party-libraries.md b/old_docs/integrations/third-party-libraries.md similarity index 100% rename from docs/integrations/third-party-libraries.md rename to old_docs/integrations/third-party-libraries.md diff --git a/docs/migrations/migrating-to-v4.md b/old_docs/migrations/migrating-to-v4.md similarity index 100% rename from docs/migrations/migrating-to-v4.md rename to old_docs/migrations/migrating-to-v4.md diff --git a/docs/previous-versions/zustand-v3-create-context.md b/old_docs/previous-versions/zustand-v3-create-context.md similarity index 100% rename from docs/previous-versions/zustand-v3-create-context.md rename to old_docs/previous-versions/zustand-v3-create-context.md