How to use the redux-toolbelt.makeActionCreator function in redux-toolbelt

To help you get started, we’ve selected a few redux-toolbelt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github baoduy / React-MaterialUI-Starter-Kit / src / actions / notifications / NotificationActions.js View on Github external
title,
    group,
    createdOn: moment(),
    onClick,
    status: NotificationStatus.NEW
  };
}

/**
 * Add or Update Notifications to Redux Store.
 *
 * @export addOrUpdateNotification
 * @param {Array of NotificationItemPropTypes} items
 * @returns
 */
export const addOrUpdateNotifications = makeActionCreator(TYPES.AddedOrUpdated);

/**
 * Delete the Notitications
 *
 * @export deleteNotifications
 * @param {Array of NotificationItemPropTypes} items
 * @returns
 */
export const deleteNotifications = makeActionCreator(TYPES.Deleted);

/**
 * Create notification Item by calling newNotification and then call addOrUpdateNotification to add to Redux Store.
 *
 * @export notify
 * @param {NotificationType} type
 * @param {string} message
github baoduy / React-MaterialUI-Starter-Kit / src / actions / notifications / NotificationActions.js View on Github external
* Add or Update Notifications to Redux Store.
 *
 * @export addOrUpdateNotification
 * @param {Array of NotificationItemPropTypes} items
 * @returns
 */
export const addOrUpdateNotifications = makeActionCreator(TYPES.AddedOrUpdated);

/**
 * Delete the Notitications
 *
 * @export deleteNotifications
 * @param {Array of NotificationItemPropTypes} items
 * @returns
 */
export const deleteNotifications = makeActionCreator(TYPES.Deleted);

/**
 * Create notification Item by calling newNotification and then call addOrUpdateNotification to add to Redux Store.
 *
 * @export notify
 * @param {NotificationType} type
 * @param {string} message
 * @param {string?} title
 * @param {string?} group
 * @param {func?} onClick
 * @returns
 */
export function notify(type, message, title, group, onClick) {
  return addOrUpdateNotifications(
    newNotification(type, message, title, group, onClick)
  );

redux-toolbelt

Async Actions helpers for redux-toolbelt

MIT
Latest version published 2 years ago

Package Health Score

52 / 100
Full package analysis