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;