action
import { AsyncAction } from 'overmind'
export const getPosts: AsyncAction = async ({ state, actions, effects }) => {
state.isLoadingPosts = true
state.posts = await effects.api.getPosts()
state.isLoadingPosts = false
}Payload
import { Action } from 'overmind'
export const setTitle: Action<string> = ({ state }, title) => {
state.title = title
}Typing
Last updated