Skip to content
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

Potential footfun: Updated streams do not show their value until the next tick. #2

Open
JAForbes opened this issue Apr 4, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@JAForbes
Copy link
Collaborator

JAForbes commented Apr 4, 2020

I'm hesitant to label it a bug, but I think before v1 this would need to be fixed to prevent many other issues being reported by users.

@pygy suggested that S's subclock implementation may solve this. So we should definitely look into that.

I think if that doesn't pan out, we could maintain a stack of stream contexts (in our fork) and return the latest value when we can detect we're in an S context.

@JAForbes JAForbes added the bug Something isn't working label Apr 4, 2020
@pygy
Copy link
Contributor

pygy commented Apr 4, 2020

@JAForbes this is a deliberate S.js choice:

A Clear, Consistent Timeline - S apps advance through a series of discrete "ticks." In each tick, all signals are guaranteed to return up-to-date values, and state is immutable until the tick completes. This greatly simplifies the often difficult task of reasoning about how change flows through a reactive app.

Batched Updates - Multiple data signals can be changed in a single tick (aka "transactions").

We can revisit the timing model, but we must understand the systemic consequences of doing so (and I don't, right now).

Note that S.freeze() (the transaction helper) is broken by the monkeypatch as I type this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants