Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 21 12:43
    changeset-bot[bot] commented #2221
  • Sep 21 12:43
    dependabot[bot] labeled #2221
  • Sep 21 12:43
    dependabot[bot] opened #2221
  • Sep 21 12:43

    dependabot[bot] on npm_and_yarn

    Bump tmpl from 1.0.4 to 1.0.5 … (compare)

  • Sep 21 12:02
    jaimeagudo edited #2220
  • Sep 21 12:01
    changeset-bot[bot] commented #2220
  • Sep 21 12:01
    jaimeagudo opened #2220
  • Sep 20 22:21

    dependabot[bot] on npm_and_yarn

    (compare)

  • Sep 20 22:21
    dependabot[bot] closed #2201
  • Sep 20 22:21
    dependabot[bot] commented #2201
  • Sep 20 22:21

    dependabot[bot] on npm_and_yarn

    Bump prismjs from 1.23.0 to 1.2… (compare)

  • Sep 20 22:21
    changeset-bot[bot] commented #2219
  • Sep 20 22:21
    dependabot[bot] labeled #2219
  • Sep 20 22:21
    dependabot[bot] opened #2219
  • Sep 19 07:01
    shunmian edited #2218
  • Sep 19 07:00
    shunmian opened #2218
  • Sep 01 22:08

    dependabot[bot] on npm_and_yarn

    (compare)

  • Sep 01 22:08
    dependabot[bot] closed #2210
  • Sep 01 22:08
    dependabot[bot] commented #2210
  • Sep 01 22:08
    changeset-bot[bot] commented #2217
A Flores
@unflores
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
g. nicholas d'andrea
@gnidan
hey folks... does anyone happen to have a resource that describes the lifecycle of an action in the context of put/take? I'm having a hard time reasoning about put vs. putResolve, e.g., so more generally, I'm hoping to find a collection of sequence diagrams or something like that
Tim De Groote
@timdegroote
Hey everyone, small question: Does redux-saga always run its effects synchronously? Or does it sometimes wait to execute its effects. The reason why I'm askin is because I have a case where two actions are called (ACTION1 and ACTION2). ACTION1 is dispatched first and ACTION2 shortly after. Now I need a saga to respond to ACTION1 before ACTION2 hits the reducer but from my console it looks like the saga is triggered when both ACTION1 and ACTION2 are already handled by the reducer.
Amir Off
@amiroffme

Hello everyon,

I need help with this redux-saga/redux-saga#1762

Tormen Raßmann
@trassmann
@ameer157 your problem seems trivial but your description is lacking, please explain your issue more clearly
Amir Off
@amiroffme

@trassmann I have a delete acition that calls a confirmation modal that can reject or accept the call. Let's say I clicked delete like five times then clicked no and sixth time clicked yes on the confirmation modal: the generator function calls the API for a delete request (six HTTP requests) - I checked in the network tab in chrome dev tools). It seems to that when clicking "No" the confirmation modal doesn't actually reject the call of the delete generator function.

Danke sehr! :)))

Matt Foxx
@FoxxMD
What's the difference between all and join when using an array of tasks (created from fork)?
ah nevermind, all is for effects and join is for tasks
but it looks like they do the same thing, essentially
A Flores
@unflores
what is the difference between a task and an effect? I found the def of an effect: https://redux-saga.js.org/docs/basics/DeclarativeEffects.html essentially a json obj that will be run by the middleware.
Are you calling the generator functions tasks?
Ah nm, that is what it is
Rishi Kumar Chawda
@rishichawda
Hi @all, I'm having trouble deciding how to handle global errors on my sagas and I was unable to find an elegant solution to it. Currently all my sagas have a huge try block which sends errors to sentry in its catch block if there's any error. Can someone please suggest me any better solution for this? I even followed up a few issues on the GitHub repo and stackoverflow but unfortunately I couldn't find something I can say can be considered as best practice. So I wanted to know how everyone else handles this. Any help, advice or suggestion is appreciated! Thanks in advance and I hope everyone is having a nice day!
A Flores
@unflores
This doesn't surprise me, the nature of saga calls makes me think more of error catching on an individual basis. If you are hitting an api, then you'll have to deal with 400 etc. That type of thing should probably be dealt with on a case by case basis. If you are looking for a global catch-all, I found this in github: redux-saga/redux-saga#1672
It might correspond to your needs @rishichawda
Rishi Kumar Chawda
@rishichawda
@unflores I am aware of that issue and solution given there, but as you can see that makes the root saga terminate. Which I don't want. I want to handle the errors and restart / rollback etc if anything like that happens.
Rishi Kumar Chawda
@rishichawda
Also, I'm using apisauce for calls to my api server so everything in the requests part is handled very well right now. What I wanted to do is make sure I handle possible scenarios that might happen in the production which cannot be reproduced so well manually. Like what if there's an inconsistent state or what if the data is corrupted or what if something happens on put or call. I need to handle those errors too. I'm not concerned about anything breaking in the UI since I'm having error boundaries for them but I need to make sure everything works fine with sagas too. Right now I pretty much have one try catch block in every saga which kind of feels redundant and doesn't look pretty to me. So I was looking for an elegant way to do that.
How do you handle errors in your saga btw? @unflores
A Flores
@unflores
@rishichawda we catch them in individual sagas. For me that makes the most sense, anything that gets up to the mainSaga error handler is more of a "catastrophic" error, I don't want to handle it b/c I wasn't expecting it. I just want to log it somewhere so I can deal with it later. I treat it as equivilant to a 500 from an api.
Evan Meeks
@evanmeeks
@rishichawda apisauce NICE!
@rishichawda I've been looking for something solid like this
Rishi Kumar Chawda
@rishichawda
@evanmeeks glad you found it useful. it is my go to solution for setting up things quick!
msaraac
@msaraac
Hello guys how can I get cookie with in the reducer