Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup deprecations #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tink/state/Observable.hx
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ abstract Observable<T>(ObservableObject<T>) from ObservableObject<T> to Observab

static public var isUpdating(default, null):Bool = false;

@:extern static inline function performUpdate<T>(fn:Void->T) {
#if (haxe_ver < 4) @:extern #else extern #end static inline function performUpdate<T>(fn:Void->T) {
var wasUpdating = isUpdating;
isUpdating = true;
return Error.tryFinally(fn, () -> isUpdating = wasUpdating);
Expand Down
4 changes: 2 additions & 2 deletions src/tink/state/ObservableArray.hx
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private class ArrayImpl<T> extends Invalidator implements ArrayView<T> {
public function copy()
return calc(() -> entries.copy());

@:extern inline function update<T>(fn:Void->T) {
#if (haxe_ver < 4) @:extern #else extern #end inline function update<T>(fn:Void->T) {
var ret = fn();
if (valid) {
valid = false;
Expand All @@ -231,7 +231,7 @@ private class ArrayImpl<T> extends Invalidator implements ArrayView<T> {
return ret;
}

@:extern inline function calc<T>(f:Void->T) {
#if (haxe_ver < 4) @:extern #else extern #end inline function calc<T>(f:Void->T) {
valid = true;
AutoObservable.track(this);
return f();
Expand Down
4 changes: 2 additions & 2 deletions src/tink/state/ObservableMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private class MapImpl<K, V> extends Invalidator implements MapView<K, V> impleme
public function getComparator()
return neverEqual;

@:extern inline function update<T>(fn:Void->T) {
#if (haxe_ver < 4) @:extern #else extern #end inline function update<T>(fn:Void->T) {
var ret = fn();
if (valid) {
valid = false;
Expand All @@ -180,7 +180,7 @@ private class MapImpl<K, V> extends Invalidator implements MapView<K, V> impleme
return ret;
}

@:extern inline function calc<T>(f:Void->T) {
#if (haxe_ver < 4) @:extern #else extern #end inline function calc<T>(f:Void->T) {
valid = true;
AutoObservable.track(this);
return f();
Expand Down
2 changes: 1 addition & 1 deletion src/tink/state/Promised.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ enum PromisedWith<T, E> {
class PromisedTools {
static public function next<A, B>(a:Promised<A>, f:Next<A, B>):Promise<B>
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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/tink/state/State.hx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ private class GuardedState<T> extends SimpleState<T> {
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);
}
Expand Down