Skip to content

Commit 1b1a40f

Browse files
fix(demos): fix demos
1 parent cc6867e commit 1b1a40f

File tree

26 files changed

+67
-112
lines changed

26 files changed

+67
-112
lines changed

packages/demos/posts/src/app/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as effects from './effects'
77
const app = new App(
88
{
99
effects,
10-
namespaces: {
10+
modules: {
1111
tabs,
1212
posts,
1313
users,

packages/demos/posts/src/app/posts/actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ import * as mutations from './mutations'
44
export const loadPost = (action) =>
55
action()
66
.map(operations.getNextPost)
7-
.mutation(mutations.addPost)
7+
.mutate(mutations.addPost)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import * as mutations from './mutations'
22

3-
export const changeTo = (action) => action().mutation(mutations.changeTab)
3+
export const changeTo = (action) => action().mutate(mutations.changeTab)

packages/demos/react-todomvc-typescript/src/app/actions.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export const addTodo: Action<React.FormEvent> = (action) =>
1616
.do(operations.preventEventDefault)
1717
.mutate(mutations.addTodo)
1818
.mutate(mutations.clearNewTodoTitle)
19-
.map(() => Promise.resolve())
20-
.map(() => Promise.resolve())
2119

2220
export const toggleCompleted: Action<Todo> = (action) =>
2321
action().mutate(mutations.toggleCompleted)

packages/demos/react-todomvc-typescript/src/app/computed.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/demos/react-todomvc-typescript/src/app/state.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { derive, compute } from 'overmind'
1+
import { derive } from 'overmind'
22
import * as derived from './derived'
3-
import * as computed from './computed'
43

54
export type Todo = {
65
id: string
@@ -13,5 +12,3 @@ export const todos: Todo[] = []
1312
export let newTodoTitle: string = ''
1413

1514
export const count: number = derive(derived.count)
16-
17-
export const testCount: (foo: number) => number = compute(computed.testCount)

packages/demos/react-todomvc-typescript/src/components/AddTodo/index.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { Wrapper, Input, Button, Form } from './elements'
44

55
const AddTodo: React.SFC<Connect> = ({ app }) => (
66
<Wrapper>
7-
{app.state.testCount(5)}
8-
{app.state.count}
97
<Form onSubmit={app.actions.addTodo}>
108
<Input
119
placeholder="I need to..."

packages/demos/react-todomvc/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
"repository": "git+https://github.com/cerebral/overmind.git",
99
"scripts": {
1010
"start": "parcel src/index.html --port 4000",
11-
"build": "parcel build src/index.html ",
12-
"test": "echo \"Error: no test specified\"",
13-
"prepare": "npm run build"
11+
"test": "echo \"Error: no test specified\""
1412
},
1513
"keywords": [
1614
"overmind",
Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
import * as helpers from './helpers'
1+
import * as operations from './operations'
22
import * as mutations from './mutations'
33

4-
export default (action) => ({
5-
changeNewTodoTitle: action()
6-
.map(helpers.getEventValue)
7-
.mutation(mutations.setNewTodoTitle),
8-
addTodo: action()
9-
.do(helpers.preventEventDefault)
10-
.mutation(mutations.addTodo)
11-
.mutation(mutations.clearNewTodoTitle),
12-
toggleCompleted: action().mutation(mutations.toggleCompleted),
13-
})
4+
export const changeNewTodoTitle = (action) =>
5+
action()
6+
.map(operations.getEventValue)
7+
.mutate(mutations.setNewTodoTitle)
8+
9+
export const addTodo = (action) =>
10+
action()
11+
.do(operations.preventEventDefault)
12+
.mutate(mutations.addTodo)
13+
.mutate(mutations.clearNewTodoTitle)
14+
15+
export const toggleCompleted = (action) =>
16+
action().mutate(mutations.toggleCompleted)

packages/demos/react-todomvc/src/app/helpers.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)