How do I import a double parentheses function in typescript?

Viewed 285

I am trying to import this: require('nforce-metadata')(nforce) in typescript. What is the way to do it? So far I tried import '('nforce-metadata')(nforce)' but didn't work. Any help? Also, I don't want it to assign it to any variable. Basically what I was doing is require('nforce-metadata')(nforce) directly and not assigning to variable.

1 Answers

You have to import it first, then initialize it.

Example:

import nforce from 'nforce'
import nforceMetadata from 'nforce-metadata'

// Initialize it
nforceMetadata(nforce)
Related