🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

redux-optimistic-ui

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-optimistic-ui

a reducer enhancer to enable type-agnostic optimistic updates

0.1.1
Source
npm
Version published
Weekly downloads
686
-17.75%
Maintainers
1
Weekly downloads
 
Created
Source

redux-optimistic-ui

a reducer enhancer to enable type-agnostic optimistic updates

##Installation npm i -S redux-optimistic-ui

A what-now?

A reducer enhance is a function you put around a reducer. It can be your rootReducer (the output from a combineReducers) or a nested one.

How's it different from redux-optimist?

redux-optimist is what I'd call a reducerExtender. It extends your reducers with an optimist. redux-optimistic-ui wraps your state. Behind the scenes, it also uses immutable.

This has a few advantages:

  • You can use immutable (or whatever the heck else you want, weirdo)
  • More performant, thanks to immutable (although if your queue is long enough to see gains, you're probably doing it wrong).
  • If you're really performance driven, you could ignore certain items from going in the queue (eg toggles, css effects, etc.)

##Usage Here's how your state will look

wrappedState = Map({
  history: List(),
  current: <YOUR STATE HERE>
})

Note: this means you gotta update your references from state to state.get('current')

...to be continued

Keywords

redux

FAQs

Package last updated on 08 Jan 2016

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