import { IUser } from './types' ; import { ExtractActionTypes , ExtractActions } from '../common/actions' ; export const UserActions = { createNewUser : ( id , user ) => ( { type : 'user.create' as const , newUser : user , id , } ) , updateUser : ( id , avatar , name , email , changeUserCreated ? ) => ( { type : 'user.update' as const , name , email , avatar , id , changeUserCreated } ) , } ; export type UserActions = ExtractActions < typeof UserActions > ; export type UserActionTypes = ExtractActionTypes < typeof UserActions > ; export const UserActionTypes = ExtractActionTypes ( UserActions ) ;