Skip to content

Commit

Permalink
Add code heading in comparison with Zustand and Redux (#1777)
Browse files Browse the repository at this point in the history
* Add code heading

* Add newline

Co-authored-by: Danilo Britto <dbritto.dev@gmail.com>

---------

Co-authored-by: Danilo Britto <dbritto.dev@gmail.com>
  • Loading branch information
BLooDBRothER and dbritto-dev authored Apr 30, 2023
1 parent e71e313 commit 22db001
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/getting-started/comparison.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -74,6 +76,8 @@ const useCountStore = create<State & Actions>((set) => ({
}))
```

**Redux**

```ts
import { createStore } from 'redux'
import { useSelector, useDispatch } from 'react-redux'
Expand Down

0 comments on commit 22db001

Please sign in to comment.