import { OutputResult } from '../api/types' ; import { UserData } from '../user/types' ; import { FeedActionType , LoadFeedAction , MessageData , PostedFeedAction , PostedFeedActionOk , PostFeedAction , UserJoinedFeedAction , UserLeftFeedAction , } from './types' ; function load ( messages , users ) { return { type : FeedActionType . Load , payload : { messages , users } } ; } function post ( body ) { return { type : FeedActionType . Post , payload : { body } } ; } function posted ( result ) { return { type : FeedActionType . Posted , payload : result } ; } function userJoined ( user ) { return { type : FeedActionType . UserJoined , payload : { user } } ; } function userLeft ( userId ) { return { type : FeedActionType . UserLeft , payload : { userId } } ; } const feedActions = { load , post , posted , userJoined , userLeft , } ; export default feedActions ;