Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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: {},
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;
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),
};
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,
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(
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',
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(
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(
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,