Repository navigation
create optimistic proxy - #423
PatrykWalach wants to merge 6 commits into
Conversation
| return storeRecord; | ||
| } | ||
|
|
||
| optimisticStoreRecord = target[p] ??= {}; |
There was a problem hiding this comment.
This is a part that's bugging me, if we have a record in original store we create a new record in optimisticLayer just in case we need to write to it.
| logFunction?.({ | ||
| kind: 'EnvironmentCreated', | ||
| }); | ||
| let optimisticLayer: OptimisticLayer = {}; |
There was a problem hiding this comment.
Rust brain has gotten to you
Also this should be caught by eslint?? (Also below)
| } | ||
| } | ||
|
|
||
| resetOptimisticLayer(environment); |
There was a problem hiding this comment.
can this just be environment.optimisticLayer = {} or something?
There was a problem hiding this comment.
I thought it shouldn't because then I have to create new proxy, but maybe it should because otherwise the old proxies point to the records that's been deleted, thoughts?
There was a problem hiding this comment.
startUpdate run inside startUpdate would surface this issue.
startUpdate((data) => {
startUpdate(()=>{}) // this is merging old changes and assigning new object to `optimisticLayer`
data // this still points to the old layer
})|
Okay, I thought about this more deeply. Take a look at #427 |
|
closing for now |
No description provided.