Skip to content

Commit 8e17f5b

Browse files
committed
Having the generic type on immer makes you lose introspection in IDE's.
1 parent 93c8ca5 commit 8e17f5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/integrations/immer-middleware.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ type Actions = {
3434
decrement: (qty: number) => void
3535
}
3636

37-
export const useCountStore = create(
38-
immer<State & Actions>((set) => ({
37+
export const useCountStore = create<State & Actions>()(
38+
immer((set) => ({
3939
count: 0,
4040
increment: (qty: number) =>
4141
set((state) => {
@@ -69,8 +69,8 @@ type Actions = {
6969
toggleTodo: (todoId: string) => void
7070
}
7171

72-
export const useTodoStore = create(
73-
immer<State & Actions>((set) => ({
72+
export const useTodoStore = create<State & Actions>()(
73+
immer((set) => ({
7474
todos: {
7575
'82471c5f-4207-4b1d-abcb-b98547e01a3e': {
7676
id: '82471c5f-4207-4b1d-abcb-b98547e01a3e',

0 commit comments

Comments
 (0)