isPending(..., true) differentiate between the source being initially pending or pending for this update. Loading also had this behavior before but that got changed/fixed as response to this issue: #2672.
What phase something is in should be based on the read instead of the source if these things are to be consistent.
This has been discussed on discord here: https://discord.com/channels/722131463138705510/780502110772658196/1504500656394997902
The fix would produce similar behavior to this:
function newIsPending(fn, loading) {
if (loading) {
fn(); // potentially try catch errors that aren't not ready errors here
}
return isPending(fn);
}
However reading fn twice would be nice to avoid if possible.
Here is a demo how the current isPending compared to this changed behaviour and how it composes with Loading boundaries.
https://s.olid.uk/id/kpIvSAwkQt6lfTbMUC6Q8g
isPending(..., true) differentiate between the source being initially pending or pending for this update. Loading also had this behavior before but that got changed/fixed as response to this issue: #2672.
What phase something is in should be based on the read instead of the source if these things are to be consistent.
This has been discussed on discord here: https://discord.com/channels/722131463138705510/780502110772658196/1504500656394997902
The fix would produce similar behavior to this:
However reading fn twice would be nice to avoid if possible.
Here is a demo how the current isPending compared to this changed behaviour and how it composes with Loading boundaries.
https://s.olid.uk/id/kpIvSAwkQt6lfTbMUC6Q8g