How to use the redux-starter-kit.createAction function in redux-starter-kit

To help you get started, we’ve selected a few redux-starter-kit 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 TronLink / tronlink-extension / packages / popup / src / reducers / accountsReducer.js View on Github external
import {
    createReducer,
    createAction
} from 'redux-starter-kit';

export const setAccount = createAction('setAccount');
export const setToken = createAction('setToken');
export const setAccounts = createAction('setAccounts');
export const setSelectedBankRecordId = createAction('setSelectedBankRecordId');
export const changeDealCurrencyPage = createAction('changeDealCurrencyPage');
export const setAirdropInfo = createAction('setAirdropInfo');

export const accountsReducer = createReducer({
    selected: {
        tokens: {
            basic: {},
            smart: {}
        },
        type: false,
        name: false,
        address: false,
        balance: 0,
        transactions: {
            // cached: [],
            // uncached: 0
github TronLink / tronlink-extension / packages / popup / src / reducers / accountsReducer.js View on Github external
import {
    createReducer,
    createAction
} from 'redux-starter-kit';

export const setAccount = createAction('setAccount');
export const setToken = createAction('setToken');
export const setAccounts = createAction('setAccounts');
export const setSelectedBankRecordId = createAction('setSelectedBankRecordId');
export const changeDealCurrencyPage = createAction('changeDealCurrencyPage');
export const setAirdropInfo = createAction('setAirdropInfo');

export const accountsReducer = createReducer({
    selected: {
        tokens: {
            basic: {},
            smart: {}
        },
        type: false,
        name: false,
        address: false,
        balance: 0,
        transactions: {
            // cached: [],
            // uncached: 0
        },
        selectedToken: {},
github piximi / application / src / reducers / classifiers.ts View on Github external
import { createAction, createReducer } from 'redux-starter-kit';
import { Classifier } from '../types';

export const createClassifierAction = createAction('classifiers/create');

export const updateClassifierNameAction = createAction(
  'classifiers/update/name'
);

const initialState: Classifier[] = [];

const classifiers = createReducer(initialState, {
  [createClassifierAction.toString()]: (state, action) => {
    const classifier = action.payload;

    state.push(classifier);
  },
  [updateClassifierNameAction.toString()]: (state, action) => {
    const { index, name } = action.payload;
github Maxvien / next-shopify-storefront / src / actions / ProductListActions.js View on Github external
import { createAction } from 'redux-starter-kit';
import { types } from '../constants';
import shopify from '../services/shopify';

export const getProductListRequest = createAction(
  types.GET_PRODUCT_LIST_REQUEST
);
export const getProductListFailure = createAction(
  types.GET_PRODUCT_LIST_FAILURE
);
export const getProductListSuccess = createAction(
  types.GET_PRODUCT_LIST_SUCCESS
);

export function getProductList() {
  return async (dispatch: Function) => {
    try {
      dispatch(getProductListRequest());

      let products = await shopify.product.fetchAll();

      products = products.map(product => {
        return {
          id: product.id,
          title: product.title,
          images: product.images.map(({ src }) => src),
        };
github TronLink / tronlink-extension / packages / popup / src / reducers / accountsReducer.js View on Github external
import {
    createReducer,
    createAction
} from 'redux-starter-kit';

export const setAccount = createAction('setAccount');
export const setToken = createAction('setToken');
export const setAccounts = createAction('setAccounts');
export const setSelectedBankRecordId = createAction('setSelectedBankRecordId');
export const changeDealCurrencyPage = createAction('changeDealCurrencyPage');
export const setAirdropInfo = createAction('setAirdropInfo');

export const accountsReducer = createReducer({
    selected: {
        tokens: {
            basic: {},
            smart: {}
        },
        type: false,
        name: false,
        address: false,
        balance: 0,
github piximi / application / src / reducers / classifier.ts View on Github external
import { createAction, createReducer } from 'redux-starter-kit';
import { Category, Classifier, Image } from '../types';

export const createCategoryAction = createAction('create-category');

export const createClassifierAction = createAction('create-classifier');

export const createImageAction = createAction('create-image');

export const createImageScoreAction = createAction('create-image-score');

export const deleteCategoryAction = createAction('delete-category');

export const deleteImageAction = createAction('delete-image');

export const toggleCategoryVisibilityAction = createAction(
  'toggle-category-visibility'
);

export const updateCategoryColorAction = createAction('update-category-color');

export const updateCategoryDescriptionAction = createAction(
  'update-category-description'
);

export const updateCategoryVisibilityAction = createAction(
github TronLink / tronlink-extension / packages / popup / src / reducers / appReducer.js View on Github external
APP_STATE,
    PAGES
} from '@tronlink/lib/constants';

import {
    createReducer,
    createAction
} from 'redux-starter-kit';

export const setAppState = createAction('setAppState');
export const setNodes = createAction('setNodes');
export const setPage = createAction('setPage');
export const setPriceList = createAction('setPriceList');
export const setCurrency = createAction('setCurrency');
export const setLanguage = createAction('setLanguage');
export const setSetting = createAction('setSetting');
export const setVersion = createAction('setVersion');
export const setDappList = createAction('setDappList');

export const appReducer = createReducer({
    appState: APP_STATE.UNINITIALISED,
    currentPage: PAGES.ACCOUNTS,
    nodes: {
        nodes: {},
        selected: false
    },
    prices: {
        priceList: {},
        usdtPriceList:{},
        selected: false
    },
    language: 'en',
github piximi / application / src / reducers / classifier.ts View on Github external
import { createAction, createReducer } from 'redux-starter-kit';
import { Category, Classifier, Image } from '../types';

export const createCategoryAction = createAction('create-category');

export const createClassifierAction = createAction('create-classifier');

export const createImageAction = createAction('create-image');

export const createImageScoreAction = createAction('create-image-score');

export const deleteCategoryAction = createAction('delete-category');

export const deleteImageAction = createAction('delete-image');

export const toggleCategoryVisibilityAction = createAction(
  'toggle-category-visibility'
);

export const updateCategoryColorAction = createAction('update-category-color');

export const updateCategoryDescriptionAction = createAction(
github piximi / application / src / reducers / classifier.ts View on Github external
export const updateCategoryColorAction = createAction('update-category-color');

export const updateCategoryDescriptionAction = createAction(
  'update-category-description'
);

export const updateCategoryVisibilityAction = createAction(
  'update-category-visibility'
);

export const updateClassifierNameAction = createAction(
  'update-classifier-name'
);

export const updateImageBrightnessAction = createAction(
  'update-image-brightness'
);

export const updateImageCategoryAction = createAction('update-image-category');

export const updateImageContrastAction = createAction('update-image-contrast');

export const updateImageVisibilityAction = createAction(
  'update-image-visibility'
);

const findCategoryIndex = (
  categories: Category[],
  identifier: string
): number => {
  return categories.findIndex(
github Maxvien / next-shopify-storefront / src / actions / ProductListActions.js View on Github external
import { createAction } from 'redux-starter-kit';
import { types } from '../constants';
import shopify from '../services/shopify';

export const getProductListRequest = createAction(
  types.GET_PRODUCT_LIST_REQUEST
);
export const getProductListFailure = createAction(
  types.GET_PRODUCT_LIST_FAILURE
);
export const getProductListSuccess = createAction(
  types.GET_PRODUCT_LIST_SUCCESS
);

export function getProductList() {
  return async (dispatch: Function) => {
    try {
      dispatch(getProductListRequest());

      let products = await shopify.product.fetchAll();

      products = products.map(product => {
        return {
          id: product.id,

redux-starter-kit

A simple set of tools to make using Redux easier

MIT
Latest version published 5 years ago

Package Health Score

78 / 100
Full package analysis