I have several utility functions. What is the best way to package these up, and then import them?
This is what I am trying to do:
import * as util f
Alternative way:
Export constants in your utils.ts
file:
export const doSomething = (val: string): any => {
return val;
};
export const doSomethingElse = (val: string): any => {
return val;
};
Import and use this methods in main *.ts
file:
import { doSomething, doSomethingElse } from './util';
...
let value1 = doSomething('abc');
let value2 = doSomethingElse ('efg');