chpill / re-frankenstein Goto Github PK
View Code? Open in Web Editor NEWThis project forked from day8/re-frame
The deviant fork of re-frame
License: MIT License
This project forked from day8/re-frame
The deviant fork of re-frame
License: MIT License
While looking at #1, I also noticed a problem with the effects that are registered in https://github.com/Day8/re-frame/blob/cf61b2db1da360687c6b247888b29fb58bedf7cb/src/re_frame/fx.cljc
:dispatch
:dispatch-later
and :dispatch-n
all use the global dispatch. :deregister-event-handler
uses the global registry.
So we will also need to swap them with "local" version when we instanciate a frank
...
The solution here will depend on what comes out of #1
I started to try writing an effect handler, akin to https://github.com/Day8/re-frame-http-fx
In the code of the handler, there is a call to dispatch
that is made...
So we need a way to allow effect handlers to dispatch "locally". The best solution is probably to inject partially applied dispatch!
and dispatch-sync!
as coeffects.
Currently, all the swapping out of handlers and middleware happpens before the creation of the frank
, so we cannot add this coeffect at that moment...
I see 2 solutions here:
When dispatching an event on frank
, systematically add an interceptor at the beginning of the chain that will make sure dispatch!
and dispatch-sync!
are available as coeffects. The issue with this is that what is stored in the registry will no longer be completely representative of what happens when you dispatch...
Make the frank
hold a registry atom instead of a registry value. Then change the state of that reference to add the new coeffect. Maybe the "local version" of the do-fx
interceptor that we inject can be extended with a :before
that takes care of that.
I'll have a go at solution 2
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.