How to use redux-actions-helpers - 10 common examples

To help you get started, we’ve selected a few redux-actions-helpers 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 kevinhikaruevans / uojs2 / src / client / components / character-delete / actions.js View on Github external
import { createAction } from 'redux-actions-helpers';

import manager from 'package/manager'

export const characterList = createAction('@@character-delete/UPDATE', ({ list, cities }) => ({
    list,
    cities
}));

export const characterDelete = payout => (dispatch, getState, transport) => {
    return new Promise((resolve, reject) => {
        const _package = manager.getPackage('_0x83');

        // @TODO: params
        transport.sendPacket(_package.create(''));
    });
};


export default {
    characterList,
github kevinhikaruevans / uojs2 / src / client / components / login / actions.js View on Github external
import { createAction } from 'redux-actions-helpers'
import manager from 'package/manager'

export const auth = createAction('@@login/AUTH', ({ username, password }) => ({
    username,
    password
}));

export const error = createAction('@@login/ERROR', ({ error }) => ({
    error
}));

export const confirm = createAction('@@login/CONFIRM');

export const complete = createAction('@@login/COMPLETE');

export const relogin = createAction('@@login/RELOGIN', ({ key }) => ({
    key
}));
github kevinhikaruevans / uojs2 / src / client / components / map / actions.js View on Github external
import { createAction } from 'redux-actions-helpers'

export const updateTiles = createAction('@@map/UPDATE_TILES', ({ blockX, blockY, tiles }) => ({
    blockX,
    blockY,
    tiles
}));

export const updateMap = createAction('@@map/UPDATE_MAP', ({ id }) => ({
    id
}));

export const updateCoordinates = createAction('@@map/UPDATE_COORDINATES', ({ x, y }) => ({
    x,
    y
}));

const hasFullBlock = ({blockX, blockY, getState}) => {
    const state = getState().map;
    const tiles = state.tiles || [];

    for(let x = blockX; x < blockX + 8; x++) {
        for(let y = blockY; y < blockY + 8; y++) {
            if (!tiles[x] ||  !tiles[x][y]) {
                return false;
github kevinhikaruevans / uojs2 / src / client / components / character / actions.js View on Github external
import { createAction } from 'redux-actions-helpers';

import manager from 'package/manager'

export const list = createAction('@@character/LIST', ({ list, cities }) => ({
    list,
    cities
}));

export const update = createAction('@@character/LIST_UPDATE', ({ list }) => ({
    list
}));

export const removeAction = createAction('@@character/REMOVE_ACTION', ({ index }) => ({
    index
}));

export const removeError = createAction('@@character/REMOVE_ERROR', ({ code, message }) => ({
    code,
    message
}));

export const remove = ({ index, password }) => (dispatch, getState, transport) => {
    dispatch(
        removeAction({ index })
    );

    const _package = manager.getPackage(0x83);

    transport.sendPacket(
github kevinhikaruevans / uojs2 / src / client / components / status-info / actions.js View on Github external
import { createAction } from 'redux-actions-helpers'

export const update = createAction('@@status-info/UPDATE', (payload) => ({
    ...payload
}));

export default {
    update
}
github kevinhikaruevans / uojs2 / src / client / components / light / actions.js View on Github external
import { createAction } from 'redux-actions-helpers'

export const overall = createAction('@@light/OVERALL', (overall) => ({
    overall
}));

export const personal = createAction('@@light/PERSONAL', ({ level, object }) => ({
    level,
    object
}));

export default {
    overall,
    personal
}
github kevinhikaruevans / uojs2 / src / client / components / ping / actions.js View on Github external
import { createAction } from 'redux-actions-helpers'
import manager from 'package/manager'

export const send = createAction('@@ping/SEND');

export const receive = createAction('@@ping/RECEIVE');

export const changeInterval = createAction('@@ping/CHANGE_INTERVAL', ({ index }) => ({
    index
}));

export const sendMaster = () => (dispatch, getState, transport) => {
    dispatch(send());

    const _package = manager.getPackage(0x73);
    transport.sendPacket(_package.create());
};


export default {
    sendMaster,
    receive,
github kevinhikaruevans / uojs2 / src / client / components / character / actions.js View on Github external
import { createAction } from 'redux-actions-helpers';

import manager from 'package/manager'

export const list = createAction('@@character/LIST', ({ list, cities }) => ({
    list,
    cities
}));

export const update = createAction('@@character/LIST_UPDATE', ({ list }) => ({
    list
}));

export const removeAction = createAction('@@character/REMOVE_ACTION', ({ index }) => ({
    index
}));

export const removeError = createAction('@@character/REMOVE_ERROR', ({ code, message }) => ({
    code,
    message
}));

export const remove = ({ index, password }) => (dispatch, getState, transport) => {
    dispatch(
        removeAction({ index })
    );
github kevinhikaruevans / uojs2 / src / client / components / character / actions.js View on Github external
import { createAction } from 'redux-actions-helpers';

import manager from 'package/manager'

export const list = createAction('@@character/LIST', ({ list, cities }) => ({
    list,
    cities
}));

export const update = createAction('@@character/LIST_UPDATE', ({ list }) => ({
    list
}));

export const removeAction = createAction('@@character/REMOVE_ACTION', ({ index }) => ({
    index
}));

export const removeError = createAction('@@character/REMOVE_ERROR', ({ code, message }) => ({
    code,
    message
}));
github kevinhikaruevans / uojs2 / src / client / components / post-login / actions.js View on Github external
import { createAction } from 'redux-actions-helpers';
import manager from 'package/manager'

export const login = createAction('@@post-login/LOGIN', ({ key }) => ({
    key
}));

export const loginMaster = payload => (dispatch, getState, transport) => {
    dispatch(login(payload));

    const state = getState().login;

    const packageSeed = manager.getPackage('seed');
    transport.sendPacket(packageSeed.create(payload.key));

    const packagePostLogin = manager.getPackage(0x91);
    transport.sendPacket(packagePostLogin.create(state.username, state.password, payload.key));
};

export default {

redux-actions-helpers

Small helpers functions for creating and handle redux actions

MIT
Latest version published 3 years ago

Package Health Score

42 / 100
Full package analysis

Popular redux-actions-helpers functions

Similar packages