Git Product home page Git Product logo

dux's Introduction

Hi, I'm Brandon. I like kind people and I write a bit of code.

dux's People

Contributors

baetheus avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

barslev

dux's Issues

feature: cancellation

  1. Refactor action creators to be standalone (namespace: string) => { createAsync, createAction }.
  2. Add cancelled action to async action factory PENDING | CANCEL | SUCCESS | FAILURE.
  3. Extend asyncExhaustMap and asyncSwitchMap to emit cancels.
  4. Update AsyncData ADT with reference count abilities.

feature: filterReducer

The actionCreatorFactory takes a group string which is prepended to any child actions. ie.

const creators = actionCreatorFactory('GROUP');

const increment = creators.simple<number>('INCREMENT');

One (unsubstantiated) claim is that redux/flux/ngrx is that there are many unneeded function calls or switch/case comparisons.

We could provide a single combinator function for optimization that filters on action group and only reduces across child functions if the parent group passes. I don't really think this is really needed in most cases (unless an app is traversing 1000s of reducers) ie:

const filterReducer = <S, P, M>(groupName: string, reducer: ActionReducer<S, P, M>): ActionReducer<S, P, M> => (state: S, action: Action<P, M>): S => action.type.startsWith(groupName) ? reducer(state, action) : state;

How to correctly use ExtractAction for inferred type on RunEvery

Not sure if just need more documentation for ExtractAction, but I can't seem to get the right action type from my actionCreators for RunEvery.

const someAction = actionFactory<number>('SomeAction')
type SomeAction = ExtractAction<typeof someAction>


const setRetrieveState: RunEvery<any, SomeAction> = (state, action) => {
  const newValue = action.value + 1 // -- | ERROR! Object is of type unknown
  return from([{type: 'SettingSomeRetrieveState', value: newValue}])
}

Where typescript infers SomeAction as

type SomeAction = Action<unknown, Record<string, any>>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.