Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redux-connect-standalone

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-connect-standalone

HOC to allow you to use redux without the need of a single root provider

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
191
decreased by-46.5%
Maintainers
1
Weekly downloads
 
Created
Source

Redux Connect Standalone

This is HOC fuction that allows you to use redux when you aren't able to have a single root Provider in your application. Eg: You are migrating a legacy application to React and has a few react components inside this application.

Before using this, you need to configure your redux store and export it, just like below.

import { createStore } from 'redux';
import rootReducer 'path/to/rootReducer';

const store = createStore(rootReducer)
export default store;

Then, you can create a file named connect, import the store into it and generate you connect function:

import createConnect from 'redux-connect-standalone';
import store from 'path/to/youStore'

export const connect = createConnect(store);

Now, you can use this function the same way you would use react-redux's connect function:

import { connect } from 'path/to/yourConnect';
import TodoList from './TodoList';

export default connect(mapStateToProps, mapDispatchToProps)(TodoList)

License

MIT

Keywords

FAQs

Package last updated on 10 Oct 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc