datavis-tech / topologica

Minimal library for reactive dataflow programming. Based on topological sort.
MIT License
50 stars 1 forks source link

Support Promises #7

Closed curran closed 6 years ago

curran commented 6 years ago

If a reactive function returns a promise, the value should be set when the promise resolves.

curran commented 6 years ago

Closing in favor of Support Aync Functions #12 .

The main reason for this is that it's not possible to know if a function will return a promise or not, until it's evaluated. Then when it is detected, we'd need to restructure the dependency graph mid-digest, which seems like more trouble than it's worth. With async functions, we can check whether they are async functions without evaluating them, which allows us to construct the correct graph in the first place, rather than modify the existing one mid-digest.