Socket
Book a DemoInstallSign in
Socket

connect-actions

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

connect-actions

Connect Redux actions by domain

0.0.4
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Connect Actions NPM version

Connect Redux actions by domain. Supports React & React Native.

Installation

npm i --save connect-actions

Usage

import connectActions from 'connect-actions';
import React, {Component, PropTypes} from 'react';
import * as NavigationActions from '../actions/navigation';
import * as UIActions from '../actions/ui';
import * as UserActions from '../actions/app';

@connectActions({NavigationActions, UIActions, UserActions})
class App extends Component {

  static propTypes = {
    NavigationActions: PropTypes.object.isRequired,
    UIActions: PropTypes.object.isRequired,
    UserActions: PropTypes.object.isRequired
  };

  componentWillMount() {
    this.props.UserActions.fetchCurrentUser();
  }

  render() {
    const {NavigationActions: {goHome}, UIActions: {showMenu}} = this.props;

    return (
      <div>
        <button onClick={goHome}>Go Home</button>
        <button onClick={showMenu}>Show Menu</button>
      </div>
    );
  }
}

License

MIT

Keywords

connect

FAQs

Package last updated on 07 Mar 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.