every and each unmounting...
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
Inizia dal comportamento AutoUnmount di Observable e dalle classi Browser::Interval e Browser::Delay menzionate nell'issue. Esamina come every, each, every! e each! gestiscono attualmente l'unmounting, quindi stabilisci quali delle semantiche proposte e quale comportamento di override debbano essere implementati. Il lavoro è completo quando il comportamento scelto del ciclo di vita del timer è coerente e coperto dai test rilevanti del progetto.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
every makes sense, as the timer will keep running for ever. But should any each timer that is still running when things unmount also be unmounted? Note that Observable includes AutoUnmount, so any store will get this behavior as well!
Then, on the other hand, there is an each! and every! method (they don't auto start, so you have to say each!(x).start. Neither of these timers IS auto-unmounted.
Couple of options:
- just take after out of unmount, and forgettabout it.
- 1 + provide a remove_after_timers method callable in Observable
- leave it, and if you want a timer that isn't unmounted use the bang variation.
- provide auto_unmount(x) attached to the timers so you say:
after(12).auto_unmount(true)orevery(12).auto_unmount(false)to override the defaults.
Currently I think its best to make both every and every! behave the same, and make each and each! not autounmount, and then add the auto_unmount method to the Browser::Interval and Browser::Delay classes.
attr_accessor :mount_point
def auto_unmount(yes)
# warning message and return if mount_point is nil
if yes
AutoUnmount.objects_to_unmount[mount_point] << self
else
AutoUnmount.objects_to_unmount[mount_point].delete(self)
end
end
alias unmount abort
now all the automounter does is set mount_point
def every!(*args, &block)
super.tap do |id|
next id if unmounted?
id.mount_point = self
id.auto_unmount(true)
end
end
def after!(*args, &block)
super.tap { |id| id.mount_point = self unless unmounted? }
end
- Lingua principale
- JavaScript
- Stelle
- 538
- Fork
- 41
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri 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 hyperstack-org/hyperstack
-
expose_as_operations method Apertaenhancement needs doc
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
hyperstack-org/hyperstack#359 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
hyperstack-org/hyperstack#267 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
hyperstack-org/hyperstack#457 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
hyperstack-org/hyperstack#456 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
hyperstack-org/hyperstack#455 · 2 commenti ·
Tutte le issue di hyperstack-org/hyperstack
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
palladius/rails8-app-on-gcp#145 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
web-platform-tests/interop#1455 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
corsairdev/corsair#1764 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100