every and each unmounting...
還沒有人認領這個 Issue。
評估
研究方向
從 Observable 的 AutoUnmount 行為以及 issue 中提到的 Browser::Interval 和 Browser::Delay 類別開始。檢查 every、each、every! 和 each! 目前如何處理卸載,然後確定應實作所提議的哪些語義以及哪種 override 行為。選定的計時器生命週期行為保持一致,並由專案的相關測試涵蓋,即視為完成。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- JavaScript
- 星號
- 538
- 分支
- 41
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
hyperstack-org/hyperstack 的其他 Issue
-
enhancement needs doc
難度 2/5 1-3 小時 新手友好度 68/100
hyperstack-org/hyperstack#359 ·
-
難度 2/5 1-3 小時 新手友好度 68/100
hyperstack-org/hyperstack#267 ·
-
難度 5/5 一週以上 新手友好度 25/100
hyperstack-org/hyperstack#457 ·
-
難度 3/5 1-2 天 新手友好度 35/100
hyperstack-org/hyperstack#456 ·
-
難度 5/5 一週以上 新手友好度 15/100
hyperstack-org/hyperstack#455 · 2 則留言 ·
查看 hyperstack-org/hyperstack 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 75/100
palladius/rails8-app-on-gcp#145 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
難度 2/5 1-3 小時 新手友好度 65/100
web-platform-tests/interop#1455 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
corsairdev/corsair#1764 ·
-
難度 2/5 1-3 小時 新手友好度 75/100