Skip to content

Commit

Permalink
Having the generic type on immer makes you lose introspection in ID…
Browse files Browse the repository at this point in the history
…E's.
  • Loading branch information
Brammm committed Oct 22, 2023
1 parent 93c8ca5 commit 8e17f5b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/integrations/immer-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ type Actions = {
decrement: (qty: number) => void
}

export const useCountStore = create(
immer<State & Actions>((set) => ({
export const useCountStore = create<State & Actions>()(
immer((set) => ({
count: 0,
increment: (qty: number) =>
set((state) => {
Expand Down Expand Up @@ -69,8 +69,8 @@ type Actions = {
toggleTodo: (todoId: string) => void
}

export const useTodoStore = create(
immer<State & Actions>((set) => ({
export const useTodoStore = create<State & Actions>()(
immer((set) => ({
todos: {
'82471c5f-4207-4b1d-abcb-b98547e01a3e': {
id: '82471c5f-4207-4b1d-abcb-b98547e01a3e',
Expand Down

0 comments on commit 8e17f5b

Please sign in to comment.