The template string
The names of the parameters (starting with the iterable) of the returned function (which can be 'seen' inside the template string)
The name of the current item of the iterable as seen inside the template string. Defaults to 'item'
Supply a tagName argument to change the name of the tag function inside the template string if the default name (T) is present in argNames.
import { asyncTemplates } from 'deleight/apriori';
let t = asyncTemplates('I will async render this ${item}')([1, 2, 3, 4, 5].map(i => Promise.resolve(i)));
console.log(t instanceof Promise); // true
t = (await Promise.all(t)).join(' ')
// t === 'I will async render this 1 I will async render this 2 I will async render this 3 I will async render this 4 I will async render this 5'
Async equivalent of templates. The async template tag ('T' by default) is applied to the template string. Use this when there are promises among the arguents that will be passed to the returned function.