Reza
Reza

Reputation: 19843

dynamic Import for multiple functions in typescript

I have a static import like below in in my code

import { findBotletByTelephonyNumber, fetchClientCustomSettings, fetchCallerStatus } from './../shared/custom-settings.service';

which are developed like below

export const findBotletByTelephonyNumber = (x) => { //return something }

and I am using them in another function.

Now I want to switch to dynamic import (Typescript), all examples on the net are importing a single module.

My question is how can I import multiple functions (one by one or all together) with dynamic import?

Upvotes: 1

Views: 1491

Answers (1)

Reza
Reza

Reputation: 19843

I figured it out, in case somebody else has same issue

const customSettingsModule = await import('./../shared/custom-settings.service');

customSettingsModule.findBotletByTelephonyNumber(6);

Upvotes: 2

Related Questions