Skip to content

async auto-observable value not being updated properly when not bound (only on v1 branch) #79

@nadako

Description

@nadako

The following code returns Loading on the second value access, unless we bind (and thus wake up and do the triggerAsync thing). Only happens on the v1 branch, master is fine:

import tink.core.Future;
import tink.state.Observable;

function main() {
	var o = Observable.auto(() -> new Future(trigger -> {
		return haxe.Timer.delay(() -> trigger(10), 500).stop;
	}));

	trace(o.value);

	haxe.Timer.delay(() -> {
		trace(o.value); // still Loading
	}, 1000);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions