2017-12-08 21:14:35 +01:00
|
|
|
// @flow
|
2017-12-21 18:32:51 +01:00
|
|
|
import * as ACTIONS from 'constants/action_types';
|
|
|
|
import type { Subscription, Dispatch } from 'redux/reducers/subscriptions';
|
2017-12-08 21:14:35 +01:00
|
|
|
|
2017-12-21 18:32:51 +01:00
|
|
|
export const doChannelSubscribe = (subscription: Subscription) => (dispatch: Dispatch) =>
|
2017-12-13 22:36:30 +01:00
|
|
|
dispatch({
|
2017-12-21 18:32:51 +01:00
|
|
|
type: ACTIONS.CHANNEL_SUBSCRIBE,
|
2017-12-08 21:14:35 +01:00
|
|
|
data: subscription,
|
|
|
|
});
|
|
|
|
|
2017-12-21 18:32:51 +01:00
|
|
|
export const doChannelUnsubscribe = (subscription: Subscription) => (dispatch: Dispatch) =>
|
2017-12-13 22:36:30 +01:00
|
|
|
dispatch({
|
2017-12-21 18:32:51 +01:00
|
|
|
type: ACTIONS.CHANNEL_UNSUBSCRIBE,
|
2017-12-08 21:14:35 +01:00
|
|
|
data: subscription,
|
|
|
|
});
|
|
|
|
|
2017-12-13 22:36:30 +01:00
|
|
|
export const setHasFetchedSubscriptions = () => (dispatch: Dispatch) =>
|
2017-12-21 18:32:51 +01:00
|
|
|
dispatch({ type: ACTIONS.HAS_FETCHED_SUBSCRIPTIONS });
|