Open jcheroske opened 7 years ago
Ping...
Yeah, since these are built-up as a chain, it is easy to add to the end or replace all, but not as easy to pull out a single one. Could I ask why you want to remove a single logic?
Very late reply... I'm exploring fractal redux components. Using libs like redux-subspace
, which is going to feature dynamic reducer injection soon. It already has support for adding/removing sagas at runtime. I want to use this lib with it. Do you think it would be possible to add a method like:
import {createLogic, injectLogic} from 'redux-logic'
const logic = createLogic({...})
const remove = injectLogic(logic) // logic is now installed
// later on
remove() // logic is now gone
Sounds interesting, I'll learn more about redux-subspace.
I guess there could be a couple ways of possibly approaching this.
I could create a fn that would do the proper replaceLogic or I could possibly create a way to flip a flag to bypass this logic after this fn was called and toggling it again if re-injected.
I'll think about the best way to approach this desired use case.
I'm wanting the ability to remove a single logic in the most non-disruptive way possible. I saw
replaceLogic
, but that seems a bit heavy-handed.