Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

every and each unmounting...

オープン
#395 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
ruby
領域
frontend

調査の方向性

Observable の AutoUnmount の挙動と、issue で言及されている Browser::Interval および Browser::Delay クラスから始めます。every、each、every!、each! が現在アンマウントをどのように処理しているかを確認し、提案されているセマンティクスのどれを実装するか、またどの override 挙動を実装するかを決定します。選択したタイマーのライフサイクルの挙動に一貫性があり、プロジェクトの関連するテストでカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

discussion enhancement

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:

  1. just take after out of unmount, and forgettabout it.
  2. 1 + provide a remove_after_timers method callable in Observable
  3. leave it, and if you want a timer that isn't unmounted use the bang variation.
  4. provide auto_unmount(x) attached to the timers so you say: after(12).auto_unmount(true) or every(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 はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

hyperstack-org/hyperstack のほかの issue

hyperstack-org/hyperstack の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。