New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to check if channel is empty? #606
Comments
Just |
Thanks for the reply @Andarist; for my use case, I just need to know if the channel is empty, but not actually empty it. |
Well, you can always pass a buffer manually, so you have reference to it and you can check its import { buffers } from 'redux-saga'
import { actionChannel } from 'redux-saga/effects'
function* saga() {
const buffer = buffers.fixed() // or some other buffer type
const chan = yield actionChannel('ACTION_TYPE', buffer)
if (buffer.isEmpty()) {
//...
}
} |
Perfect. Thanks!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the best way to determine if a channel is currently empty? The
Buffer
interface seems to describe anisEmpty
method. But how do I get at the underlying buffer from a channel?The text was updated successfully, but these errors were encountered: