Skip to content

Commit

Permalink
🔨 types
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienjuif committed Jun 21, 2018
1 parent 508f4da commit 8285bbc
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 13 deletions.
14 changes: 7 additions & 7 deletions examples/todomvc/src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import { createStore, simpleObject, keyValue } from 'k-ramel'
import { createStore, types } from 'k-ramel'
import listeners from './listeners'

export default createStore(
{
data: {
todos: keyValue({ key: 'id' }), // or you can create it this way if you want to serialize it : { type: 'keyValue', key: 'id' }
todos: types.keyValue(), // or you can create it this way if you want to serialize it : { type: 'keyValue' }
},
ui: {
views: {
all: simpleObject({ defaultData: [] }),
completed: simpleObject({ defaultData: [] }),
active: simpleObject({ defaultData: [] }),
all: types.array(),
completed: types.array(),
active: types.array(),
},
footer: simpleObject({
footer: types.object({
defaultData: {
todos: 0,
todosLeft: 0,
todosCompleted: 0,
filter: 'all',
},
}),
newTodo: simpleObject({ defaultData: '' }),
newTodo: types.string(),
},
},
{
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@
"rules": {
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
"max-len": [
2,
200
],
"semi": [
2,
"never"
Expand Down
2 changes: 1 addition & 1 deletion packages/k-ramel/dist/index.es.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8285bbc

Please sign in to comment.