lbry-desktop/src/renderer/redux/actions/subscriptions.js

19 lines
612 B
JavaScript
Raw Normal View History

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