0

How do I do something that transpiles into this:

var foo = require('foo')() 

Doing that doesn't work:

require! { 
  \foo !
}

of course I can run it right after the require!, but I was hoping for a shorter form

iLemming
  • 34,477
  • 60
  • 195
  • 309

2 Answers2

1

You can't with require!, I would just use the original require

foo = require('foo')!

gkz
  • 416
  • 3
  • 5
1

incase you are going to be import a few packages
you can also do:

require! {
  bar
  foo
  'some-thing'
}
someThing = someThing!
foo = foo!
gabeio
  • 1,282
  • 1
  • 23
  • 37