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
We teach users to pass state values into operations.
But state references can go stale (an issue made worse by global state, which I think should be removed, see #17) or not be assigned yet because they are read synchronously.
For example:
get('/some-data')
post('some-data', state.data)
This code will fail because the value of state.data is read synchronously, because the get was completed.
It should be written with some kind of lazy state evaluation, like this:
The compiler should be able to detect references to state (literally that global variable reference) and raise a warning when it is used in a naive chain like this.
The text was updated successfully, but these errors were encountered:
josephjclark
changed the title
Compiler: warn when bare state chain are used
Compiler: warn when bare state chains are used
Apr 2, 2024
We teach users to pass state values into operations.
But state references can go stale (an issue made worse by global state, which I think should be removed, see #17) or not be assigned yet because they are read synchronously.
For example:
This code will fail because the value of state.data is read synchronously, because the get was completed.
It should be written with some kind of lazy state evaluation, like this:
The compiler should be able to detect references to
state
(literally that global variable reference) and raise a warning when it is used in a naive chain like this.The text was updated successfully, but these errors were encountered: