@politie/sherlock-utils
Version:
Utility functions that are designed to work with Sherlock. His toolbelt.
18 lines (17 loc) • 551 B
TypeScript
import { Derivable } from '@politie/sherlock';
/**
* A template literal tag to create a string derivation using a template literal.
*
* For example:
*
* ```
* const name$ = atom('Pete');
* const age$ = atom(24);
* const nameAndAge$ = template`${name$} is ${age$} years old`;
* nameAndAge$.get(); // -> Pete is 24 years old
* ```
*
* @param parts the string parts
* @param args the results of the expressions inside the template literal
*/
export declare function template(parts: TemplateStringsArray, ...args: any[]): Derivable<string>;