lib/tapioca/runtime/trackers.rb in tapioca-0.10.1 vs lib/tapioca/runtime/trackers.rb in tapioca-0.10.2

- old
+ new

@@ -1,6 +1,32 @@ -# typed: strict +# typed: true # frozen_string_literal: true + +require "tapioca/runtime/trackers/tracker" + +module Tapioca + module Runtime + module Trackers + extend T::Sig + + @trackers = T.let([], T::Array[Tracker]) + + class << self + extend T::Sig + + sig { void } + def disable_all! + @trackers.each(&:disable!) + end + + sig { params(tracker: Tracker).void } + def register_tracker(tracker) + @trackers << tracker + end + end + end + end +end # The load order below is important: # ---------------------------------- # We want the mixin tracker to be the first thing that is # loaded because other trackers might apply their own mixins