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

@modular-toolkit/selectors

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@modular-toolkit/selectors

Utility functions for connecting selectors for a state object to a global Redux state

  • 3.0.4
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

selectors

Utility functions to use selectors for decoupled React components with a global Redux state.

Installation

npm install --save @modular-toolkit/selectors

Note: by default, the npm package exposes ES5-compatible code (transpiled through Babel).

If you want to use the untranspiled code (highly recommended), us the esnext version, which is included in the same npm package (more info here).

API

createModularSelector

This is a drop in replacement for reselect.createSelector and is used to create composed, cachable selectors.

This drop-in replacement is required, because the original function provided by Reselect does not play nicely with the registerSelectorsForUseWithGlobalState module.

registerSelectorsForUseWithGlobalState

This utility function allows you to register selectors that use the context of a self-contained module to a global Redux state.

For an example, take a look at this code from the demo app:

import { registerSelectorsForUseWithGlobalState } from '@modular-toolkit/selectors';
import * as hackerNewsSelectors from '@modular-toolkit/demo-module/selectors';

export default () => registerSelectorsForUseWithGlobalState(
    'modules.hackerNews',
    hackerNewsSelectors
);
  • The first argument is a string that denotes the path to the module's state in the global state
  • The second argument is an object containing the selectors

selectModular

A version of redux-saga.select, allows you to use the global selector mechanism described above with Sagas.

Change Log

Contribution Guidelines

License

MIT licensed

Copyright © 2018 mobile.de GmbH

FAQs

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