Properly convert dataflow-assertions to simple values to allow the `is` check to work
This commit is contained in:
parent
25c701cd4e
commit
ff1b013d66
|
@ -80,7 +80,10 @@ export function toRef(_v: any): Ref | undefined {
|
||||||
return isRef(_v) ? _v : void 0;
|
return isRef(_v) ? _v : void 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function assertionFrom(a: Assertable): Assertion {
|
export function assertionFrom(a: Assertable): Assertion;
|
||||||
|
export function assertionFrom(a: Assertable | undefined): Assertion | undefined;
|
||||||
|
export function assertionFrom(a: Assertable | undefined): Assertion | undefined {
|
||||||
|
if (a === void 0) return void 0;
|
||||||
if (typeof a === 'object' && '__as_preserve__' in a) {
|
if (typeof a === 'object' && '__as_preserve__' in a) {
|
||||||
return fromJS(a);
|
return fromJS(a);
|
||||||
} else {
|
} else {
|
||||||
|
@ -464,6 +467,7 @@ export class Turn {
|
||||||
let assertion: Assertable | undefined = void 0;
|
let assertion: Assertable | undefined = void 0;
|
||||||
this.dataflow(() => {
|
this.dataflow(() => {
|
||||||
let {target: nextTarget, assertion: nextAssertion} = assertionFunction();
|
let {target: nextTarget, assertion: nextAssertion} = assertionFunction();
|
||||||
|
nextAssertion = assertionFrom(nextAssertion);
|
||||||
if (target !== nextTarget || !is(assertion, nextAssertion)) {
|
if (target !== nextTarget || !is(assertion, nextAssertion)) {
|
||||||
target = nextTarget;
|
target = nextTarget;
|
||||||
assertion = nextAssertion;
|
assertion = nextAssertion;
|
||||||
|
|
Loading…
Reference in New Issue