Reverting values to their previously committed value before Reactivity propagates still triggers recomputation
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia eseguendo il Solid playground collegato e tracciando il batch call, gli aggiornamenti di signal e l’output di effect descritti nei passaggi per la riproduzione. Confronta il valore finale di signal con i calcoli che vengono eseguiti, quindi stabilisci il comportamento previsto e aggiungi o aggiorna la coverage per il ripristino di un valore all’interno di un batch.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
Within a batch call, when setting a signal's value to a new value, and then back to the original value, effects are still run for the "changed" value.
This could be desired behavior, but I think an argument could be made for the behavior I'm expecting here.
The playground I've linked is a contrived example. I encountered this when trying to batch a couple store actions together, that involved this scenario of a value being changed, and then changed back to the original value at the start of the batch operation.
Your Example Website or App
https://playground.solidjs.com/anonymous/157e35f6-d812-4798-8222-082d559eec5f
Steps to Reproduce the Bug or Issue
- Go to the playground link
- Switch to the Console output in dev tools
- Click the 'Click' button
- Despite the final value of
num()being unchanged at the end ofbatch(...), the effect is run, and the "new" value ofnum()is logged to the console.memoNum()naturally does not have the same issue.
Expected behavior
I expect changes to signal values within batch to be "batched", with only the end result being considered in determining what changed and what effects to run. Note that when calling setNum(0) when num() is already 0, effects are not rerun.
Sorry I know this is probably an inaccurate expectation of what batch should do. The docs description doesn't make a lot of sense to me:
# batch
Holds executing downstream computations within the block until the end to prevent unnecessary recalculation. Solid Store's set method, Mutable Store's array methods, and Effects automatically wrap their code in a batch.
Screenshots or Videos
No response
Platform
N/A
Additional context
No response
- Lingua principale
- TypeScript
- Stelle
- 37k
- Fork
- 1.2k
- Merge medio
- 8h 43m
- PR unite (30g)
- 365
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di solidjs/solid
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
I maintainer di solito rispondono entro 1 giorno
-
[2.0.4] Nested `<Errored>`: the outer boundary stays on an error the inner one rethrew, after the next error is one the inner one handlesForse già presa @MilindChatrabhuji l’ha presa 2 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di solidjs/solid
Issue simili
-
agentscan:mixed-signals pending triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
vueuse/vueuse#5737 · 2 commenti ·
I maintainer di solito rispondono entro 9 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Marker-Inc-Korea/AutoRAG#2288 ·
I maintainer di solito rispondono entro 1 giorno
-
Resources: New templates of Guangzhou Metro Line 13Forse già presa @rmt-svc l’ha presa oggi. Apertaresources
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 76/100
railmapgen/rmg-templates#2730 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
web
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno