Comments (3)
Hi! Thanks so much for reaching out.
First and foremost: redux-saga
is in a stable state and as such backwards compatibility is our primary directive. If you can implement the ability to change debounce
-- and throttle
-- in a non-breaking way, I'd be happy to review and approve.
I'm also happy to answer any questions you have.
from redux-saga.
Hi! You are welcome to just focus on debounce
for now if that makes things simpler for you.
from redux-saga.
I made a start on this. It seems straightforward enough for debounce - my initial attempt at that is here (work in progress) but throttle is a little trickier.
I think the current implementation of throttle would correspond to the leading: true, trailing: true
case. For the leading, true, trailing: false
case, I think it's as simple as just using buffers.none()
instead of buffers.sliding(1)
). And leading: false, trailing: false
should be simple too (since it basically does nothing).
However, I'm not sure how to approach the leading: false, trailing: true
case for throttle.
I wanted to use an fsm like this:
fsmIterator(
{
q1() {
const yActionChannel = { done: false, value: actionChannel(patternOrChannel, buffers.sliding(1)) }
return { nextState: 'q2', effect: yActionChannel, stateUpdater: setChannel }
},
q2() {
return { nextState: 'q3', effect: yTake(), stateUpdater: setAction }
},
q3() {
return { nextState: 'q4', effect: yDelay }
},
q4() {
// If another action has been received since the leading edge,
// use that for the trailing edge.
return channel.isEmpty()
? { nextState: 'q5', effect: yTake, stateUpdater: setAction }
: { nextState: 'q5', effect: yNoop }
},
q5() {
return { nextState: 'q2', effect: yFork(action) }
},
},
needsChannel ? 'q1' : 'q2',
`throttle(${safeName(patternOrChannel)}, ${worker.name})`,
)
...but channel.isEmpty()
is a non-existent method. I'm not sure how to achieve this without some way of checking whether the channel is empty.
from redux-saga.
Related Issues (20)
- Waiting for an action with takeMaybe / take after END is dispatched for SSR HOT 7
- Is it possible to selectively cancel tasks in an actionChannel? Ie cancel the 3rd task out of 5 running ones. HOT 5
- Is it possible for a saga to "trace" the effect "chain"? HOT 4
- Delay inside of while loop may never fire with React Native 0.71.6 HOT 2
- UI freezes when chrome devtools is open HOT 4
- Redux 4.0 - Unable to access updated data using useSelector HOT 2
- Workflow has flaw
- Why not use the await and async instead of the generator and yield? HOT 1
- TS2345 error while putting thunk actions
- React native Redux Saga with Redux Tollkit
- Module '"redux-saga/effects"' has no exported member 'call'. HOT 4
- Is there a standard way to break while true loops with call effect when END is dispatched? HOT 1
- Can put type improvements be released downstream? HOT 2
- Sending very large files, tasks in parallel are using a lot of memory
- How to use package that use redux-saga as dependency when its in webpack externals? HOT 7
- Help me connect redux-saga with Nextjs 13.5 using app router HOT 2
- Update peer dependencies to include `redux@5` (currently beta) HOT 14
- feature request: interface for integration with other frameworks (like Vue) HOT 2
- Redux saga is not working in apps script react js project HOT 2
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 redux-saga.