s2s plugin for
d
$ yarn add --dev babel-plugin-s2s-d-action-constants
import { type UserRes } from '../../types/Api'
import * as constants from './constants'
export type FetchUser = {
type: typeof constants.FETCH_USER,
payload: string,
}
export type FetchUserSuccess = {
type: typeof constants.FETCH_USER_SUCCESS,
payload: UserRes,
}
export type Action = FetchUser | FetchUserSuccess
// @flow
import { type UserRes } from '../../types/Api'
import * as constants from './constants'
import type { Action } from './types'
export const fetchUser = (payload: string): Action => {
return {
type: constants.FETCH_USER,
payload,
}
}
export const fetchUserSuccess = (payload: UserRes): Action => {
return {
type: constants.FETCH_USER_USER,
payload,
}
}
{
['s2s-d-action-creater']
}