Hi, I'm Brandon. I like kind people and I write a bit of code.
baetheus / dux Goto Github PK
View Code? Open in Web Editor NEWTools for writing portable redux, flux, and ngrx code. Type safe and boilerplate reducing.
Tools for writing portable redux, flux, and ngrx code. Type safe and boilerplate reducing.
Hi, I'm Brandon. I like kind people and I write a bit of code.
(namespace: string) => { createAsync, createAction }
.PENDING | CANCEL | SUCCESS | FAILURE
.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;
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>>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.