Hot reloading
lmatteis opened this issue · 4 comments
Someone on gitter pointed out that hot reloading isn't possible with redux-cycles. We should have a solution for this. Tagging this as enhancement
An interesting approach to hot-reloading would be to mock all side effects when calling Cycle.run. For instance during development you don't actually want to perform certain HTTP request - GET requests you may want them to go through, but not POSTs/PUTs.
There could be a way to pass a HOD (high order driver) that wraps HTTP driver and filters POSTs/PUTs request to not contact server; but just return mock data-- so the UI can be used without modifying server-state.
In general, isn't hot reloading of any Redux side-effect approach a huge pita? Both sagas and cycles can have local, implicit state which can make hot-reloading useless in many cases even if cycles can be rebooted.
An alternative could be to keep track of action history and replay on hot reload, but this can be problematic as well... because changes in cycles can now change the past.
Wondering whether https://github.com/Widdershin/cycle-restart will work
You could probably adapt cycle-restart for this usecase, it might just work™.