How do you import "run" from @ember/runloop?


#1

I used to be able to do:

import run from 'ember-runloop';

But I can’t seem to find how to do that with the new imports. Anyone know how I can do that now?


#2

I am still slow to internalize all the new module import paths too, I typically use https://github.com/ember-cli/ember-rfc176-data#new-modules-to-globals for a quick cross reference.


#3

You the man!


#4

Todd also just got the import syntax added to the api docs, so you should be able to see it show up there now … https://www.emberjs.com/api/ember/2.18/classes/@ember%2Frunloop/methods/run?anchor=run


#5

Another way to learn is to make sure your editor is running eslint for you in realtime. The eslint rules provided in recent versions of ember-cli will tell you how to rewrite the old-style into the new style. In Emacs it looks like this:

When I forget the new thing, I just write the old thing and let eslint tell me the new thing.