npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@redux-eggs/core

v3.0.0-alpha.4

Published

This package includes logic for creating Redux store and adding/removing/counting `eggs`.

Downloads

7,912

Readme

Redux Eggs Core

This package includes logic for creating Redux store and adding/removing/counting eggs.

Contents:

Intro

The main function that does all the work is called buildStore.

Most likely you will never need to use this function directly, since Redux Eggs already includes packages like @redux-eggs/redux and @redux-eggs/redux-toolkit, which are a high-level API for creating Redux store using Redux or Redux Toolkit, respectively.

Installation:

If you are using Yarn, run

yarn add @redux-eggs/core

If you are using NPM, run

npm install --save @redux-eggs/core

API Reference

buildStore(storeCreator, combiner, composeMiddlewares, [extensions])

This is a wrapper that allows you to create Redux store with the necessary methods to add/remove/count eggs. It returns an object with Redux store and some methods from Redux Eggs.

Arguments:

storeCreator(reducer, middlewareEnhancer, enhancersFromExtensions, middlewaresFromExtensions)

  • reducer - a root reducer that is required to dynamically add/remove reducers.
  • middlewareEnhancer - a root middleware that is required to dynamically add/remove middleware.
  • enhancersFromExtensions - an array of enhancers from Extensions.
  • middlewaresFromExtensions - an array of middlewares from Extensions.

combiner(reducersMap)

A function for combining reducers. Default: combineReducers.

composeMiddlewares(...functions)

A function for composing middlewares. Default: compose.

extensions

An array of Extensions. This is an optional argument.

Example:

import { buildStore } from '@redux-eggs/core'
import * as Redux from 'redux'

const store = buildStore(reducer => Redux.createStore(reducer), Redux.combineReducers, Redux.compose)

REDUCE_ACTION_TYPE

Redux Action Type. Redux action with this type is triggered after a successful addition or removal of reducers. This is an internal action, it is necessary for the correct state update after adding or removing reducers.

Example:

import { REDUCE_ACTION_TYPE } from '@redux-eggs/core'

const myMiddleware = store => next => action => {
  if (action.type === REDUCE_ACTION_TYPE) {
    console.log(action) // -> { type: '@@eggs/reduce' }
  }

  return next(action)
}

getCounter([equalityCheck], [keepCheck])

This function will be useful for developers of extensions for Redux Eggs. All details you can find here.