You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now when using $i it puts the result (when finished) on the global namespace - the window.
I'm proposing that instead it returns a promise (due to the async nature of import) that evaluates with the result of executing the desired imported module.
Something like this
$i('lodash').then(_=>_.toNumber(null));
This could also be used with top-level await like this
const_=await$i('lodash');_.toNumber(null);
This is gives you the control whether or not you want to pollute the global namespace and how.
Plus, now you don't have to know how the internal module exposes itself ($, _, etc.)
The text was updated successfully, but these errors were encountered:
Right now when using
$i
it puts the result (when finished) on the global namespace - the window.I'm proposing that instead it returns a promise (due to the async nature of import) that evaluates with the result of executing the desired imported module.
Something like this
This could also be used with top-level await like this
This is gives you the control whether or not you want to pollute the global namespace and how.
Plus, now you don't have to know how the internal module exposes itself (
$
,_
, etc.)The text was updated successfully, but these errors were encountered: