Skip to content

Commit 4d1b005

Browse files
Merge pull request cerebral#58 from cerebral/composition
fix(overmind): fix namespaced state adding, also update guides
2 parents bc2ba8f + 3dce506 commit 4d1b005

File tree

24 files changed

+163
-41
lines changed

24 files changed

+163
-41
lines changed

logo.png

-2.39 KB
Loading

logo.psd

-8.74 KB
Binary file not shown.

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

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as operations from './operations'
2+
import * as mutations from './mutations'
3+
4+
export const loadPost = (action) =>
5+
action()
6+
.map(operations.getNextPost)
7+
.mutation(mutations.addPost)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import * as state from './state'
2+
import * as actions from './actions'
3+
4+
export { state, actions }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const addPost = (state, post) => state.posts.list.unshift(post)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const getNextPost = ({ state, api }) =>
2+
api.getPost(state.posts.list.length + 1)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export let list = []

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

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import * as mutations from './mutations'
2+
3+
export const changeTo = (action) => action().mutation(mutations.changeTab)

0 commit comments

Comments
 (0)