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

30 lines
840 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,
});
export const setSubscriptionLatest = (subscription: Subscription, uri: string) => (dispatch: Dispatch) =>
{
return dispatch({
type: ACTIONS.SET_SUBSCRIPTION_LATEST,
data: {
subscription,
uri
}
})
};
2017-12-13 22:36:30 +01:00
export const setHasFetchedSubscriptions = () => (dispatch: Dispatch) =>
dispatch({ type: ACTIONS.HAS_FETCHED_SUBSCRIPTIONS });