New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

redux-su

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-su

Redux simple utils

latest
Source
npmnpm
Version
0.3.4
Version published
Maintainers
1
Created
Source

Redux Simple Utils

Description

Package with useful utils for Redux.

Connect decorator

Replacement for react-redux connect

Usage:

import {connect} from 'redux-su';
import actions from './redux/actions'; // { user: { auth: () => {}, login: () => {} ... }, ... [actionGroup] : { [actionName] : [actionFunc], ...} }

const selectors = {
    byPath: 'user.todos[0].title',
    byFunc: (store) => store.user.todos[0].title,
};

@connect(selectors, actions)
class Test extends React.Component {
    render () {
        return (
            <ul>
                <li>By path: {this.props.byPath}</li>
                <li>By function: {this.props.byFunc}</li>
            </ul>
        );
    }
}

Create Reducer helper

Small helper for reducer

Usage:

import {createReducer} from 'redux-su';

export default const Reducer = createReducer({
    'ACTION_1': (store, action) => ({...store, action1: 'fired!'}),
    'ACTION_2': (store, action) => ({...store, action2: action.payload}),
});

Keywords

redux

FAQs

Package last updated on 24 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts