evgenyorekhov / actus Goto Github PK
View Code? Open in Web Editor NEWMinimalist, boilerplate-free, framework-agnostic state container
Home Page: https://www.npmjs.com/package/actus
License: MIT License
Minimalist, boilerplate-free, framework-agnostic state container
Home Page: https://www.npmjs.com/package/actus
License: MIT License
mergeDeep()
)It might be not needed if #5 is implemented by adding redux-devtools-extension integration.
The following forms are supported by default:
(value, state) => nextState
(value) => nextState
() => nextState
(value) => (state) => nextState
Pros:
state
value
and state
state
, so you end up writing something like (value, state) => pipe(/* uses value and state */)(state)
, so the usage of point-free style ends up being impossible, AND this feature can actually be easily added to other forms with the help of the getNextState
optionCons:
value
, have to write (ignore, state) => nextState
(state, value) => nextState
(state) => nextState
() => nextState
Pros:
value
state
and value
Cons:
state
, have to write (ignore, value) => nextState
({ state, value }) => nextState
Pros:
Cons:
state
and value
(you can do something like ({ state: users, value: newUser }) => ...
, but it's not as convenient as with positional parameters)Notes:
value
the best name? How about argument
? Or a more conventional payload
?If actus is going to add support for something like async actions (or effects), the current API will have to be extended, and the best candidate for extension is the Object API.
Similar to https://github.com/react-stack/redux-storage.
Immer gets in the way even when you're not using it:
TypeError: Cannot perform 'isExtensible' on a proxy that has been revoked
It would be better for subscribers to be tolerant to other subscribers' errors.
Reproducible case: https://github.com/EvgenyOrekhov/super-rentals/tree/must-use-import-to-load-es-module-bug
$ npm start
> [email protected] start C:\super-rentals
> ember serve
Must use import to load ES Module: C:\super-rentals\node_modules\actus-ember\index.js
require() of ES modules is not supported.
require() of C:\super-rentals\node_modules\actus-ember\index.js from C:\super-rentals\node_modules\ember-cli\lib\models\package-info-cache\package-info.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from C:\super-rentals\node_modules\actus-ember\package.json.
Probably should be something like inject(target, config)
.
https://www.npmjs.com/package/deep-freeze
.travis.yml
engines
in package.json
The reason is that subscribers are notified on state changes, not on action calls. This behavior is by design. Not sure what to do here. Perhaps turn the logger plugin into a special internal subscriber that will be notified on action calls, not on state changes.
https://gist.github.com/srdjan/1d10cbd42a2d695f696dee6b47fdc5e0
Can be done by the means of conditional require()
calls.
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.