public static object saveReadyStateToDB(SocketResponseSessionData data) { return(new ThunkAction <AppState>((dispatcher, getState) => { MessengerDBApi.SyncSaveReadyState(data); dispatcher.dispatch(new SaveReadyStateToDBSuccessAction()); return Promise.Resolved(); })); }
public static object saveMessagesToDB(List <ChannelMessage> messages) { return(new ThunkAction <AppState>((dispatcher, getState) => { MessengerDBApi.SyncSaveMessages(messages); dispatcher.dispatch(new SaveMessagesToDBSuccessAction()); return Promise.Resolved(); })); }
public static object loadReadyStateFromDB() { return(new ThunkAction <AppState>((dispatcher, getState) => { var data = MessengerDBApi.SyncLoadReadyState(); dispatcher.dispatch(new LoadReadyStateFromDBSuccessAction { data = data }); return Promise.Resolved(); })); }
public static object loadMessagesFromDB(string channelId, long before) { return(new ThunkAction <AppState>((dispatcher, getState) => { var messages = MessengerDBApi.SyncLoadMessages(channelId, before, 10); dispatcher.dispatch(new LoadMessagesFromDBSuccessAction { messages = messages, before = before, channelId = channelId }); return Promise.Resolved(); })); }