Closed RobLoach closed 7 years ago
Not sure if this is done right.
renderAsync
should be added to the list of fallbacks for compileAsync
above.
The error should be the only statement inside if (!this.can('compileAsync'))
.
After if (this._hasMethod('compileAsync'))
, you should add an else if (this.can('renderAsync'))
block, containing your call to renderAsync
.
Hope this is clear enough.
@RyanZim Thanks for the feedback. Still not working :-( Added a test. Know what it's missing? Feel free to commit directly to the branch.
When calling compileAsync(), we should fallback to renderAsync()
We can't. compileAsync()
has to return {fn: Function, dependencies: Array.<String>}
and fn
has to return a string. If we use renderAsync()
under the hood, fn
will return a promise, not a string.
I never thought of this before, but since there's no way to make something async return synchronously, we're out of options. It just won't work.
I guess close this. Is there a particular transformer that you need this for?
@RobLoach ping?
You're right, we can't do it unfortunately. Maybe best way to do it would be implementing both functions in the transformers... I'll close this for now. Thanks!
When calling compileAsync(), we should fallback to renderAsync(). Not sure if this is done right.