From c693cf38fb4c5e19163ceb3770755fa85e22cec9 Mon Sep 17 00:00:00 2001 From: Juraj Kirchheim Date: Tue, 6 Jun 2023 09:48:47 +0200 Subject: [PATCH] Remove some deprecated stuff. --- src/tink/state/Observable.hx | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) diff --git a/src/tink/state/Observable.hx b/src/tink/state/Observable.hx index 42a1281..11f10ec 100644 --- a/src/tink/state/Observable.hx +++ b/src/tink/state/Observable.hx @@ -1,17 +1,5 @@ package tink.state; -private typedef BindingOptions = Deprecated<{ - ?direct:Bool, - ?comparator:T->T->Bool, -}>; - -@:forward -abstract Deprecated(T) { - @:deprecated - @:from static function of(v:X):Deprecated - return cast v; -} - /** Common representation of a piece of observable state. It can be read using the `value` property and bound to listen for changes using the `bind` method. @@ -56,16 +44,7 @@ abstract Observable(ObservableObject) from ObservableObject to Observab You can customize this behaviour by passing a different `scheduler` and `comparator` instances to this function. **/ - public function bind( - #if tink_state.legacy_binding_options ?options:BindingOptions, #end - callback:Callback, ?comparator:Comparator, ?scheduler:Scheduler - ):CallbackLink { - #if tink_state.legacy_binding_options - if (options != null) { - comparator = options.comparator; - if (options.direct) scheduler = Scheduler.direct; - } - #end + public function bind(callback:Callback, ?comparator:Comparator, ?scheduler:Scheduler):CallbackLink { if (scheduler == null) scheduler = Observable.scheduler; return Binding.create(this, callback, scheduler, comparator); @@ -121,18 +100,6 @@ abstract Observable(ObservableObject) from ObservableObject to Observab public function mapAsync(f:Transform>):Observable> return Observable.auto(() -> f.apply(this.getValue())); - @:deprecated('use auto instead') - public function switchSync(cases:Array<{ when: T->Bool, then: Lazy> } > , dfault:Lazy>):Observable - return Observable.auto(() -> { - var v = value; - for (c in cases) - if (c.when(v)) { - dfault = c.then; - break; - } - return dfault.get().value; - }); - static var scheduler:Scheduler = #if macro Scheduler.direct;