Skip to content

Commit 411d02a

Browse files
docs(website): fix getting started typo
1 parent e2a4c88 commit 411d02a

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

packages/overmind-website/examples/guide/getstarted/actions.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default (ts, view) =>
88
code: `
99
import { Action } from 'overmind'
1010
11-
export const loadPosts: Action = async ({ state, effects }) => {
11+
export const getPosts: Action = async ({ state, effects }) => {
1212
state.isLoadingPosts = true
1313
state.posts = await effects.jsonPlaceholder.getPosts()
1414
state.isLoadingPosts = false
@@ -46,13 +46,15 @@ export const overmind = new Overmind({
4646
posts: []
4747
},
4848
effects: {
49-
getPosts() {
50-
return fetch('https://jsonplaceholder.typicode.com/posts')
51-
.then(response => response.json())
49+
jsonPlaceholder: {
50+
getPosts() {
51+
return fetch('https://jsonplaceholder.typicode.com/posts')
52+
.then(response => response.json())
53+
}
5254
}
5355
},
5456
actions: {
55-
loadPosts: async ({ state, effects }) => {
57+
getPosts: async ({ state, effects }) => {
5658
state.isLoadingPosts = true
5759
state.posts = await effects.jsonPlaceholder.getPosts()
5860
state.isLoadingPosts = false

packages/overmind-website/examples/guide/getstarted/triggeraction.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { connect } from '../overmind'
99
1010
class Posts extends React.Component {
1111
componentDidMount() {
12-
this.props.overmind.actions.loadPosts()
12+
this.props.overmind.actions.getPosts()
1313
}
1414
render() {
1515
const { overmind } = this.props
@@ -52,7 +52,7 @@ import { connect } from '../overmind'
5252
5353
export default connect({
5454
mounted() {
55-
this.overmind.actions.loadPosts()
55+
this.overmind.actions.getPosts()
5656
}
5757
})
5858
`,
@@ -70,7 +70,7 @@ import { Connect, connect } from '../overmind'
7070
7171
class Posts extends React.Component<Connect> {
7272
componentDidMount() {
73-
this.props.overmind.actions.loadPosts()
73+
this.props.overmind.actions.getPosts()
7474
}
7575
render() {
7676
const { overmind } = this.props
@@ -115,7 +115,7 @@ import { connect } from '../overmind'
115115
@connect()
116116
export class PostsList {
117117
ngOnInit() {
118-
this.overmind.actions.loadPosts()
118+
this.overmind.actions.getPosts()
119119
}
120120
}
121121
`,

0 commit comments

Comments
 (0)