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

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?

I am still slow to internalize all the new module import paths too, I typically use GitHub - ember-cli/ember-rfc176-data: JSON data for Ember.js RFC #176 for a quick cross reference.

4 Likes

You the man!

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

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.