Skip to content

Commit

Permalink
Fix: 1.3.1 (#89)
Browse files Browse the repository at this point in the history
* fix: setState action name format same as isListener

* chore: initialState
  • Loading branch information
alvinhui authored Apr 3, 2020
1 parent c29fe9c commit eb98857
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 11 additions & 1 deletion examples/todos/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@ import TodoAdd from './components/TodoAdd';
import User from './components/User';
import Car from './components/Car';

const initialState = {
user: {
dataSource: {
name: 'Tom',
},
auth: true,
todos: 5,
},
};

const { Provider } = store;;

function App() {
return (
<Provider>
<Provider initialState={initialState}>
<Todos />
<TodoAdd />
<User />
Expand Down
12 changes: 1 addition & 11 deletions examples/todos/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,7 @@
import { createStore, IcestoreRootState, IcestoreDispatch } from '@ice/store';
import models from './models';

const initialState = {
user: {
dataSource: {
name: 'Tom',
},
auth: true,
todos: 5,
},
};

const store = createStore(models, { initialState });
const store = createStore(models);

export default store;
export type Store = typeof store;
Expand Down
2 changes: 1 addition & 1 deletion src/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const randomString = () =>
.join('.');

const ActionTypes = {
SET_STATE: `@@icestore/SET_STATE${/* #__PURE__ */ randomString()}`,
SET_STATE: `@@icestore_SET_STATE${/* #__PURE__ */ randomString()}`,
};

export default ActionTypes;

0 comments on commit eb98857

Please sign in to comment.