every and each unmounting...
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
Beginne mit dem AutoUnmount-Verhalten von Observable und den in der Issue erwähnten Klassen Browser::Interval und Browser::Delay. Überprüfe, wie every, each, every! und each! derzeit das Unmounting handhaben, und kläre anschließend, welche der vorgeschlagenen Semantiken und welches Override-Verhalten implementiert werden sollen. Als erledigt gilt die Aufgabe, wenn das gewählte Verhalten des Timer-Lebenszyklus konsistent ist und durch die relevanten Tests des Projekts abgedeckt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- JavaScript
- Sterne
- 538
- Forks
- 41
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus hyperstack-org/hyperstack
-
enhancement needs doc
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
hyperstack-org/hyperstack#359 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
hyperstack-org/hyperstack#267 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
hyperstack-org/hyperstack#457 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
hyperstack-org/hyperstack#456 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
hyperstack-org/hyperstack#455 · 2 Kommentare ·
Alle Issues in hyperstack-org/hyperstack
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
palladius/rails8-app-on-gcp#145 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
web-platform-tests/interop#1455 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
corsairdev/corsair#1764 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100