Skip to content

Commit

Permalink
Use merged reduxDevtools in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
szhsin committed Dec 28, 2022
1 parent 5ed4ce1 commit a23ae53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/examples/counter/Counter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const reducer = (state: number, { type, by = 1 }: { type: ActionTypes; by?: numb
const persistMiddleware = persist({ prefix: 'counter-', getStorage: () => sessionStorage });

const counterState = createState({
middleware: applyMiddleware(persistMiddleware, reduxDevtools)
middleware: applyMiddleware(persistMiddleware, reduxDevtools({ name: 'counterApp-state' }))
})(
0,
(set, get) => ({
Expand Down
8 changes: 4 additions & 4 deletions examples/examples/todo/todo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { reduxDevtools as devtoolsPlugin } from 'reactish-state/plugin';

const persistMiddleware = persist({ prefix: 'todoApp-' });
const state = createState({
middleware: applyMiddleware(immer, persistMiddleware, reduxDevtools)
middleware: applyMiddleware(immer, persistMiddleware, reduxDevtools({ name: 'todoApp-state' }))
});

interface Todo {
Expand Down Expand Up @@ -33,13 +33,13 @@ const todoListState = state(
{ type: 'todos/deleteItem', id }
)
}),
{ key: 'todo-list' }
{ key: 'todoList' }
);

type VisibilityFilter = 'ALL' | 'COMPLETED' | 'IN_PROGRESS';
const visibilityFilterState = state('IN_PROGRESS' as VisibilityFilter, null, { key: 'filter' });

const selector = createSelector({ plugin: devtoolsPlugin });
const selector = createSelector({ plugin: devtoolsPlugin({ name: 'todoApp-selector' }) });
const visibleTodoList = selector(
todoListState,
visibilityFilterState,
Expand All @@ -53,7 +53,7 @@ const visibleTodoList = selector(
return todoList.filter(({ isCompleted }) => !isCompleted);
}
},
{ key: 'visible-todos' }
{ key: 'visibleTodos' }
);

const statsSelector = selector(
Expand Down

0 comments on commit a23ae53

Please sign in to comment.