Skip to content

Instantly share code, notes, and snippets.

@bryzettler
Created April 4, 2018 15:06
Show Gist options
  • Save bryzettler/07413bbde941e8024f04afc72b2e3271 to your computer and use it in GitHub Desktop.
Save bryzettler/07413bbde941e8024f04afc72b2e3271 to your computer and use it in GitHub Desktop.
import { createNamespacedAction } from '../../utils/actionsUtils';
const stompAction = createNamespacedAction('@stomp');
export const connect = stompAction('CONNECT');
export const messageRecevied = stompAction('MESSAGE_RECEVIED');
export const disconnect = stompAction('DISCONNECT');
export const subscribe = stompAction('SUBSCRIBE', ({ subscriptionName, destination, onmessage }) => ({
subscriptionName,
destination,
onmessage,
}));
export const unsubscribe = stompAction('UNSUBSCRIBE', subscriptionName => ({ subscriptionName }));
export const unsubscribeAll = stompAction('UNSUBSCRIBE_ALL');
export const connecting = stompAction('CONNECTING');
export const connected = stompAction('CONNECTED');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment