Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 20 11:05
    demedos commented #970
  • Oct 18 17:47
    acdvs commented #2227
  • Oct 18 17:46
    acdvs commented #2227
  • Oct 18 12:34
    SpandanNepal edited #2227
  • Oct 18 12:34
    SpandanNepal commented #2227
  • Oct 18 04:44
    acdvs commented #2227
  • Oct 18 04:41
    acdvs commented #2227
  • Oct 18 04:40
    acdvs commented #2227
  • Oct 17 16:34
    Andarist commented #2227
  • Oct 17 16:09
    SpandanNepal edited #2227
  • Oct 17 16:07
    SpandanNepal opened #2227
  • Oct 16 01:25
    brykov commented #2216
  • Oct 14 05:08
    Andarist commented #1610
  • Oct 14 00:40
    saadq commented #1610
  • Oct 12 17:21
    Andarist commented #2021
  • Oct 12 17:11
    hmansh commented #2021
  • Oct 11 06:23
    thevijaysoni commented #1985
  • Oct 06 22:43
    changeset-bot[bot] commented #2223
  • Oct 06 22:43

    dependabot[bot] on npm_and_yarn

    Bump url-parse from 1.5.1 to 1.… (compare)

  • Oct 06 22:43
    dependabot[bot] opened #2223
Christian Maniewski
@chmanie
@Andarist if I do an if-statement, I basically have to re-implement the matching against strings (types) and patterns. It’s not much but it would be great if I could re-use that
Tormen Raßmann
@trassmann
@chmanie i get the point though, usually you have strict control over what goes into your custom channel no? assuming that, generic matching logic would be overkill
Christian Maniewski
@chmanie
Yeah, I guess you’re right, I probably won’t be needing anything besides string comparisons
Christian Maniewski
@chmanie
I have another question: I’m not entirely sure around the workings of the try-finally construct when using a while(true). How do we get in the finally clause there?
Tormen Raßmann
@trassmann
from w3c: The finally statement lets you execute code, after try and catch, regardless of the result.
i dont understand the question, do you mean why it triggers?
Christian Maniewski
@chmanie
Yeah, what kicks us out of the while(true)
Oh, ok probably an error is thrown
Tormen Raßmann
@trassmann
when any code wrapped in a try block throws an exception the catch/finally will trigger
Christian Maniewski
@chmanie
So take(END) actually throws an error?
Tormen Raßmann
@trassmann
END just kills all takers on the standard channel
so take(END) is kinda redundant
Christian Maniewski
@chmanie
But then it’s caught internally by redux-saga somehow, I guess
Tormen Raßmann
@trassmann
its contradictary actually
A Flores
@unflores
right but to get to finally there has to be an exception thrown right?
Tormen Raßmann
@trassmann

right but to get to finally there has to be an exception thrown right?

yea

Christian Maniewski
@chmanie
Note also we're executing the whole while (true) {...} loop inside a try/finally block. When the interval terminates, the countdown function closes the event channel by invoking emitter(END).
Tormen Raßmann
@trassmann

But then it’s caught internally by redux-saga somehow, I guess

probably you are getting an exception because take(END) is not meant to be done, thats what take.maybe is for

Christian Maniewski
@chmanie
Yeah, I think I was just confused that there’s no error but redux-saga seems to catch that specific one for me
A Flores
@unflores
er nm what am I saying.
This message was deleted
try{ console.log('derp') } catch(err){console.log(err)}finally{console.log('yerp')}
gives 'derp' 'yerp'
so no need for an exception to be thrown
Christian Maniewski
@chmanie
wait, where’s your while(true) @unflores
A Flores
@unflores
I was confused about the usage of finally, no idea how they drop out of while(true) maybe a break somehow?
Christian Maniewski
@chmanie
An exception is needed to break out of this
Tormen Raßmann
@trassmann

so no need for an exception to be thrown

yea it also executes when the try block finishes executing, but it wont in this case since its an endless loop

(unless an exception is thrown)
Christian Maniewski
@chmanie
Can I take the same action multiple times from a channel? It seems the first taker gets it and after that it’s removed from the buffer, is that right?
Christian Maniewski
@chmanie
Yep, FIFO
Another thing. As far as I can see, when I emit an Error in an eventChannel and then take from that channel it should throw, right? This doesn’t really work for me. Meaning it just doesn’t throw it seems
Christian Maniewski
@chmanie
Tests say it shoud 🤔
Christian Maniewski
@chmanie
It does, I’m just doing it wrong it seems
Tormen Raßmann
@trassmann

Can I take the same action multiple times from a channel? It seems the first taker gets it and after that it’s removed from the buffer, is that right?

yea, unless you use multicast channel, then every taker is triggered

Christian Maniewski
@chmanie
:+1:
Oh now all these names make much more sense
Tormen Raßmann
@trassmann
redux saga has an amazing api IMO but it takes some getting used to that way of doing stuff
A Flores
@unflores
Does anyone know where the docs for multicast are? I would like to look them over, https://redux-saga.js.org/docs/introduction/ doesn't have a section that screams multicast at me
Tormen Raßmann
@trassmann
@unflores the docs are a bit behind i'm afraid
image.png
but ask away, the maintainers and users hang out here and are likely to be able to answer your questions
A Flores
@unflores
Ah ok. Cool. Honestly I wanted to look at it to have a few ideas about what the usage would be. I'm not very creative :)
I tried digging through the code recently and I was a little lost.
Tormen Raßmann
@trassmann
i asked about it in december here
image.png
A Flores
@unflores
I assume it gives you the possiblity to treat sagas as a message broker. I have a hard time arriving at a good use case, but like I said, creativity problems :)
ah, cool. thanks for the info