mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
Add code heading in comparison with Zustand and Redux (#1777)
* Add code heading * Add newline Co-authored-by: Danilo Britto <dbritto.dev@gmail.com> --------- Co-authored-by: Danilo Britto <dbritto.dev@gmail.com>
This commit is contained in:
parent
e71e313bd7
commit
22db0014bb
@ -21,6 +21,8 @@ both are based on an immutable state model.
|
||||
However, Redux requires your app to be wrapped
|
||||
in context providers; Zustand does not.
|
||||
|
||||
**Zustand**
|
||||
|
||||
```ts
|
||||
import { create } from 'zustand'
|
||||
|
||||
@ -74,6 +76,8 @@ const useCountStore = create<State & Actions>((set) => ({
|
||||
}))
|
||||
```
|
||||
|
||||
**Redux**
|
||||
|
||||
```ts
|
||||
import { createStore } from 'redux'
|
||||
import { useSelector, useDispatch } from 'react-redux'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user