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

edux

v0.2.2

Published

Edux is DRY version of Redux (no constants and switches, actions and reducers are generated from changes).

Downloads

19

Readme

Edux is Redux without (R)epetition

Edux is DRY version of Redux. Edux allows to manage state of Javascript appications writing less code and still have full compatibility with Redux ecosystem, i.e. use Redux DevTools in browser.

You don't need to add constants and share them between actions and reducers. You even don't need to write actions and reducer — Edux generates them from changes files.

Edux and Redux works well together. Redux state is single source of truth on data level. Edux changes are single source of truth on logic level.

Edux processes actions with O(1) speed instead of Redux's O(N) where N is number of reducers.

Bellow is an example of using Edux's changes for creating standard Redux store:

// changes.js
import { actionCreator } from 'edux'

export const DEFAULT_STATE = []

export function addTodo (state, text) {
  return [...state, {id: nextId(state), text}]
}

export function addTodoAsync (state, text) {
  return dispatch => setTimeout(() => {
    dispatch(actionCreator(addTodo)(text))
  }, 1000)
}


// index.js
import { createStore } from 'redux'
import { createActions, createReducer } from 'edux'

import * as changes from './changes'
const { addTodo, addTodoAsync } = createActions(changes)

const futureDispatch = (action) => store.dispatch(action)
const futureGetState = () => store.getState()
const reducer = createReducer(changes, futureDispatch, futureGetState)
const store = createStore(reducer, preloadedState, enhancer)

render(
  <Provider store={store}>
    <App addAction={ addTodoAsync } />
  </Provider>,
  document.getElementById('root')
)

Full example of Edux and Redux integration you can see in examples/async folder. This example is ported from the official Redux's example, so you can compare both implementations.

Examples

Installation

To install the stable version:

npm install --save edux

The Redux source code is written in ES2015 but we precompile both CommonJS and UMD builds to ES5 so they work in any modern browser.

You can use Edux together with React, or with any other view library.
It is tiny (1kB, including dependencies).

License

MIT