Describe the bug
s2.a does not show isPending even though it is derived from s.a which is pending by an explicit call to affects(s,'a')
let [s,ss] = createOptimisticStore(()=>{
return {a:1}
}, {a:0})
let [s2,ss2] = createOptimisticStore(()=>{
return s
}, {a:0} as unknown as any)
console.log('s.a',isPending(()=>s.a))
console.log('s2.a', isPending(()=>s2.a))
affects(s,'a')
console.log('affects (s,"a")')
console.log('s.a',isPending(()=>s.a)) // s.a is pending due to an explict affect
console.log('s2.a', isPending(()=>s2.a)) // s2.a is derived from s.a but is not pending
Your Example Website or App
https://s.olid.uk/id/rp_IuUpuTqO9bYy85uoFGA
Steps to Reproduce the Bug or Issue
run code.
Expected behavior
derived key in an optimistic store, from another optimistic store, should also derive the explicit pending set by the affects() call on the store key.
Screenshots or Videos
Platform
.
Additional context
source for llm
Describe the bug
s2.a does not show isPending even though it is derived from s.a which is pending by an explicit call to
affects(s,'a')Your Example Website or App
https://s.olid.uk/id/rp_IuUpuTqO9bYy85uoFGA
Steps to Reproduce the Bug or Issue
run code.
Expected behavior
derived key in an optimistic store, from another optimistic store, should also derive the explicit pending set by the
affects()call on the store key.Screenshots or Videos
Platform
.
Additional context
source for llm