Open m-nab opened 4 years ago
I'm not sure this would be possible without duplicating essentially the whole evaluator. I agree it would be useful though, so I'll give it some thought.
Made async work in https://github.com/j2L4e/expr-eval/tree/async It passes the original test suite but as you said, it basically required copying the whole thing, so I just changed it to all-async for now.
edit: also minification is broken right now
This would be extremely useful for us too. Currently, we are having to pre-process formulas that may include async functions, execute the async functions, replace their result in the formula, and then evaluate it with expr-eval.
Just want to chime in that this would be a great addition though it would be nice to be able to retain both a synchronous and asynchronous code paths - which might be a bit complicated as already mentioned.
My use case is to remotely load a YAML file with parameters to parse into a dictionary which is then used in the expression eval for this robotics xacro format parser: https://github.com/gkjohnson/xacro-parser.
This would be a very useful enhancement. My use case is to fetch stock quotes and be able to do calculations on their prices.
Hi,
Would it be possible to add a Asynchronous evaluator ? I am currently using this libray to call a couple of functions dynamically, however I do have a a couple of functions which are asynchronous in nature. Since the evaluation happens instantly, it immediately resolves the pending promise instead of the value.
So the case would be something like this;
Although I do realize this was not the intended use-case.