From a31711c0d36ad0f45a1d637fdd7913ccb764b195 Mon Sep 17 00:00:00 2001 From: Abraham Gellis Date: Sat, 21 Oct 2023 16:52:36 -0400 Subject: [PATCH 1/2] @:extern -> extern for Haxe 4+ --- src/tink/state/Observable.hx | 2 +- src/tink/state/ObservableArray.hx | 4 ++-- src/tink/state/ObservableMap.hx | 4 ++-- src/tink/state/State.hx | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tink/state/Observable.hx b/src/tink/state/Observable.hx index 732632d..69cf345 100644 --- a/src/tink/state/Observable.hx +++ b/src/tink/state/Observable.hx @@ -145,7 +145,7 @@ abstract Observable(ObservableObject) from ObservableObject to Observab static public var isUpdating(default, null):Bool = false; - @:extern static inline function performUpdate(fn:Void->T) { + #if (haxe_ver < 4) @:extern #else extern #end static inline function performUpdate(fn:Void->T) { var wasUpdating = isUpdating; isUpdating = true; return Error.tryFinally(fn, () -> isUpdating = wasUpdating); diff --git a/src/tink/state/ObservableArray.hx b/src/tink/state/ObservableArray.hx index 2b591bd..daaf86d 100644 --- a/src/tink/state/ObservableArray.hx +++ b/src/tink/state/ObservableArray.hx @@ -222,7 +222,7 @@ private class ArrayImpl extends Invalidator implements ArrayView { public function copy() return calc(() -> entries.copy()); - @:extern inline function update(fn:Void->T) { + #if (haxe_ver < 4) @:extern #else extern #end inline function update(fn:Void->T) { var ret = fn(); if (valid) { valid = false; @@ -231,7 +231,7 @@ private class ArrayImpl extends Invalidator implements ArrayView { return ret; } - @:extern inline function calc(f:Void->T) { + #if (haxe_ver < 4) @:extern #else extern #end inline function calc(f:Void->T) { valid = true; AutoObservable.track(this); return f(); diff --git a/src/tink/state/ObservableMap.hx b/src/tink/state/ObservableMap.hx index cffcd61..8db84df 100644 --- a/src/tink/state/ObservableMap.hx +++ b/src/tink/state/ObservableMap.hx @@ -171,7 +171,7 @@ private class MapImpl extends Invalidator implements MapView impleme public function getComparator() return neverEqual; - @:extern inline function update(fn:Void->T) { + #if (haxe_ver < 4) @:extern #else extern #end inline function update(fn:Void->T) { var ret = fn(); if (valid) { valid = false; @@ -180,7 +180,7 @@ private class MapImpl extends Invalidator implements MapView impleme return ret; } - @:extern inline function calc(f:Void->T) { + #if (haxe_ver < 4) @:extern #else extern #end inline function calc(f:Void->T) { valid = true; AutoObservable.track(this); return f(); diff --git a/src/tink/state/State.hx b/src/tink/state/State.hx index 91fdc69..7b1fa27 100644 --- a/src/tink/state/State.hx +++ b/src/tink/state/State.hx @@ -105,7 +105,7 @@ private class GuardedState extends SimpleState { if (!guardApplied) applyGuard(); else value; - @:extern inline function applyGuard():T { + #if (haxe_ver < 4) @:extern #else extern #end inline function applyGuard():T { this.guardApplied = true; return value = guard(value); } From 0adf867577df39d3a879f19d2caf76550aab8c00 Mon Sep 17 00:00:00 2001 From: Abraham Gellis Date: Sat, 21 Oct 2023 16:52:59 -0400 Subject: [PATCH 2/2] Promise.NEVER -> Promise.never() --- src/tink/state/Promised.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tink/state/Promised.hx b/src/tink/state/Promised.hx index 8f79291..4acc5a4 100644 --- a/src/tink/state/Promised.hx +++ b/src/tink/state/Promised.hx @@ -13,7 +13,7 @@ enum PromisedWith { class PromisedTools { static public function next(a:Promised, f:Next):Promise return switch a { - case Loading: Promise.NEVER #if (tink_core < "2" && haxe_ver >= "4.2") .next(_ -> (null:B)) #end; + case Loading: Promise.never() #if (tink_core < "2" && haxe_ver >= "4.2") .next(_ -> (null:B)) #end; case Failed(e): e; case Done(a): f(a); }