Describe the bug
after the write, calling isPending on count is true
but putting it in latest() is false
logs
[log] {pendingLatest_1: false, isPendingCount_1: false}
[log] {pendingLatest_2: false, isPendingCount_2: true}
Your Example Website or App
https://s.olid.uk/id/VojPF1iuQ26A0fQNPRHjKg
Steps to Reproduce the Bug or Issue
see reproduction
Expected behavior
it might be expected that latest will not return false for isPending
that returns true for one without latest
Screenshots or Videos
No response
Platform
.
Additional context
import { render } from '@solidjs/web';
import { createSignal, isPending, latest } from 'solid-js';
export default function App() {
const [count, setCount] = createSignal(0);
setTimeout(() => {
const pendingLatest_1 = latest(() => isPending(count))
const isPendingCount_1 = isPending(count)
console.log({
pendingLatest_1,
isPendingCount_1
})
setCount(v => v + 1) // start a transiton
const isPendingCount_2 = isPending(count) // true
const pendingLatest_2 = latest(() => isPending(count)) // false
console.log({
pendingLatest_2,
isPendingCount_2
})
})
return (
<div class="p-2 whitespace-pre">
{`
latest shadows pending state
`}
</div>
);
}
if (typeof document !== 'undefined') {
render(() => <App />, document.getElementById('root')!);
}
unlike #3104 , there is no memo in this case. just plain read, in the same scope / tick
Describe the bug
after the write, calling
isPendingoncountis truebut putting it in
latest()is falselogs
Your Example Website or App
https://s.olid.uk/id/VojPF1iuQ26A0fQNPRHjKg
Steps to Reproduce the Bug or Issue
see reproduction
Expected behavior
it might be expected that
latestwill not return false for isPendingthat returns true for one without
latestScreenshots or Videos
No response
Platform
.
Additional context
unlike #3104 , there is no memo in this case. just plain read, in the same scope / tick