Home Reference Source

application/redux/actions/snackbar-actions.js

/**
 * Action Types
 */

export const SNACKBAR_SHOW_MESSAGE = 'SNACKBAR_SHOW_MESSAGE';
export const SNACKBAR_CLOSE = 'SNACKBAR_CLOSE';

/**
 * Action creators
 */

export function snackbarShowMessage(message, duration = 3000) {
    return {
        type: SNACKBAR_SHOW_MESSAGE,
        payload: {
            message: message,
            duration: duration
        }
    }
};

export function snackbarClose() {
    return {
        type: SNACKBAR_CLOSE,
        payload: {}
    }
};