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

redux-bundler-hook

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

redux-bundler-hook

React bindings to redux-bundler with hooks

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Redux-Bundler Hook

CircleCI

React.js bindings to Henrik Joreteg's redux-bundler.

See redux-bundler documentation at https://reduxbundler.com/

Installation

npm install redux-bundler-hook

Usage

wrap your React app with a provider

import { hydrate } from 'react-dom'
import { ReduxBundlerProvider } from 'redux-bundler-hook'

import createStore from '../bundles'

const store = createStore()

hydrate(
  <ReduxBundlerProvider store={store}>
    <App />
  </ReduxBundlerProvider>,
  document.getElementById('root')
)

use the hook in your components

import { useConnect } from 'redux-bundler-hook'

import AppLayout from './AppLayout'

export default function App() {
  const {
    route: { component: RoutedComponent },
    colorScheme,
    doSetColorScheme,
  } = useConnect('selectRoute', 'selectColorScheme', 'doSetColorScheme')

  return (
    <AppLayout>
      <RoutedComponent colorScheme={colorScheme} onSetColorScheme={doSetColorScheme} />
    </AppLayout>
  )
}

In cases you need a store itself down your component tree, this package also exports useReduxBundlerStore hook that will return the store.

Keywords

FAQs

Package last updated on 04 May 2019

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