New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

duxegg

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

duxegg

Simple module concept for redux

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

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

duxegg

Simple module concept for redux

Benefits

  • Simple module concept for abstracting redux dependencies from one another
  • Modules are easy to compose together
  • Simple hook system for tapping in to redux lifecycle
  • Provides a framework for building out an entire application (if desired)

Build Status

npm version
Build Status
NPM

Install

npm install --save duxegg

Usage

// app.js
import React from 'react'
import { Provider } from 'react-redux'
import { createStore } from 'duxegg'
import * as modules from './modules'

const config = {
  foo: { // config passed to module is based on name of module
    key: 'value'
  }
}

const App = () =>
  <Provider store={createStore(modules, config)}>
    ...
  </Provider>

export default App
// modules/index.js
import * from 'foo'
export {
  foo
}
// modules/foo/index.js
import { handleActions } from 'redux-actions'
import createSagaMiddleware from 'redux-saga'

const module = (config) => {
  const middleware = createSagaMiddleware()

  const reducer = handleActions({
    ...
  })

  const saga = function* saga() {
    ...
  }

  const run = (store) => {
    // store is a redux store with an additional getModules method
    const modules = store.getModules()

    // do whatever you need to boot up this module or process some value from the other modules
  }

  return {
    middleware,
    reducer,
    saga
  }
}

export {
  module
}

Keywords

FAQs

Package last updated on 26 May 2018

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