You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a writable/readable store with a start callback that synchronously calls its set callback. (Note: derived creates such a store when its own callback is synchronous.)
Subscribe with any number of subscribers, then unsubscribe them all.
Subscribe with a "new first subscriber".
Expected results: Each subscriber gets called exactly once upon subscribing, no matter what.
Actual results: The "new first subscriber" is called twice. REPL
Looking at the source code, I see set tries to guard against this, but it doesn't always work because stop isn't always falsy when needed. That could be fixed, but maybe we don't need the guard at all - why does subscribe add the subscriber before calling start? Can we safely reverse that?
The text was updated successfully, but these errors were encountered:
PixievoltNo1
added a commit
to PixievoltNo1/svelte-writable-derived
that referenced
this issue
Jun 14, 2019
Steps to reproduce:
writable
/readable
store with astart
callback that synchronously calls itsset
callback. (Note:derived
creates such a store when its own callback is synchronous.)Expected results: Each subscriber gets called exactly once upon subscribing, no matter what.
Actual results: The "new first subscriber" is called twice. REPL
Looking at the source code, I see
set
tries to guard against this, but it doesn't always work becausestop
isn't always falsy when needed. That could be fixed, but maybe we don't need the guard at all - why doessubscribe
add the subscriber before callingstart
? Can we safely reverse that?The text was updated successfully, but these errors were encountered: