Comments (8)
There seems to be a usecase for this mentioned on twitter by @undoZen
:
https://twitter.com/undoZen/status/500573096403693568
@spoike I want to write a "dispatcher" for it because I want to hot reload it while development and transport states from server to browser.
https://twitter.com/undoZen/status/500573412461252610:
@spoike but I found it's very difficult to extend Store prototype, acctually its imposible.
from refluxjs.
I am also interrested by HMR (hot module replacement) provided by webpack. Would be nice to have feedback from @undoZen.
from refluxjs.
Never heard of webpack until now. I've seen some small projects before that loads module packs form the server, but not really hotswapping like replacing code completely. Seems wickedly cool and I wouldn't mind listening in on a discussion for this and if there is anything we can do with reflux to make this simpler.
from refluxjs.
You should definitely check react-hot-loader. I use it in my daily development and it's pretty awesome. Since I am new to Reflux I need more experience to see if it integrates well with this loader.
from refluxjs.
I'm also new to these kind of stuff: react, flux, webpack HMR, etc. So much cool things to learn and experiment, very exciting.
Actually I didn't quite get how so called flux architecture works with dispatcher suggested by facebook or yahoo, until I find this project and read @spoike's blog on ghost.io, it all make sense about how actions and store should be working together for me.
I am also experimenting with webpack HMR recently, and I tried develop a personal project using reflux, react and react-hot-loader, but I found the stores won't work with hot reload because old version of stores still exists in memory since they are still listening to actions and be listened by other stores. Also I think the dehydrate/rehydrate feature from yahoo's dispatchr is very cool because that make server generation of static page of SPA react app possible.
So there are reasons to have a dispatcher. I'm starting to build one based on reflux, but found that the store prototype is difficult to extend.
Here's what I got now. You can refer to the test case to get how should it be working with re-definition of stores. It works but I have to monkey patch the listen method and alter the store definition now, if I can extend mixins of them it must be easier for me to implement this dispatcher module.
from refluxjs.
I hope 0.1.8 could include this enhancement. I'll try to make a pull request late this week.
from refluxjs.
Sure. :-) I've tried but unfortunately managed to break a lot of tests in the process. So I have to defer to this until later or unless anyone else want to help out.
from refluxjs.
This is done by @krawaller among the pull requests for the work on 0.1.8, see #67.
What is left is to document the listenerMethods and the other mixins properly.
from refluxjs.
Related Issues (20)
- init not firing HOT 1
- Object doesn't support property or method 'createActions' IE 11 HOT 1
- Support of React.js v16 HOT 6
- How are keys handled if a component is attached to multiple stores with the same key? HOT 2
- Async/await pattern with async actions HOT 3
- can we have react 16.x compatibility HOT 4
- TypeError: str.listen is not a function HOT 1
- Extending Reflux Store HOT 1
- async in Server Rendering HOT 1
- TypeError: Super expression must either be null or a function, not undefined HOT 1
- setState callback not executed in store HOT 2
- setState should support callbacks, same as the typical react setState HOT 1
- reflux store this.setState callback
- Store listening to actions after dismount
- async actions return undefined instead of Promise HOT 3
- Cannot Use Reflux Components With React getDerivedStateFromProps() Static Method HOT 3
- Roadmap questions HOT 5
- react组件中获取元素节点,使用focus方法,报错focus未定义
- Feature Request: Make Reflux available for Functional Components HOT 1
- Please mark project as dead
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from refluxjs.