Repository URL to install this package:
|
Version:
1.5.3 ▾
|
export const ActionTypes = {
BOOT: '@doodle/intercom/BOOT',
TRACK_EVENT: '@doodle/intercom/TRACK_EVENT',
SHOW: '@doodle/intercom/SHOW',
SHOW_MESSAGES: '@doodle/intercom/SHOW_MESSAGES',
SHOW_NEW_MESSAGE: '@doodle/intercom/SHOW_NEW_MESSAGE',
HIDE: '@doodle/intercom/HIDE',
UPDATE: '@doodle/intercom/UPDATE',
SHUTDOWN: '@doodle/intercom/SHUTDOWN',
};
export const boot = () => ({
type: ActionTypes.BOOT,
});
export const trackEvent = (event, metadata = {}) => ({
type: ActionTypes.TRACK_EVENT,
payload: {
event,
metadata,
},
});
export const show = () => ({
type: ActionTypes.SHOW,
});
export const showMessages = () => ({
type: ActionTypes.SHOW_MESSAGES,
});
export const showNewMessage = () => ({
type: ActionTypes.SHOW_NEW_MESSAGE,
});
export const hide = () => ({
type: ActionTypes.HIDE,
});
export const update = userDetails => ({
type: ActionTypes.UPDATE,
payload: {
...userDetails,
},
});
export const shutdown = () => ({
type: ActionTypes.SHUTDOWN,
});