How to use redux-toolbelt - 4 common examples

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)
  );
github baoduy / React-MaterialUI-Starter-Kit / src / views / Dashboard / Reducer.jsx View on Github external
import { makeAsyncReducer } from "redux-toolbelt";
import actions from "./Actions";

const chartsReducer = makeAsyncReducer(actions.getChartData);
const generalReducer = makeAsyncReducer(actions.getGeneral);

export default {
    chartsReducer,
    generalReducer
};
github baoduy / React-MaterialUI-Starter-Kit / src / views / Dashboard / Reducer.jsx View on Github external
import { makeAsyncReducer } from "redux-toolbelt";
import actions from "./Actions";

const chartsReducer = makeAsyncReducer(actions.getChartData);
const generalReducer = makeAsyncReducer(actions.getGeneral);

export default {
    chartsReducer,
    generalReducer
};

redux-toolbelt

Async Actions helpers for redux-toolbelt

MIT
Latest version published 1 year ago

Package Health Score

58 / 100
Full package analysis