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
While not my intention when initially creating laxy, it ended up being a drop in replacement for this module.
It has a few key advantages:
It's a more generalized Proxy generator. Allowing for any generator function (not just require), and allows passing any number of arguments.
It implements much more of the Proxy API. Allowing things like Object.keys, Object.getPrototypeOf, setting values, and reflecting on property descriptors of the underlying object, etc.
laxy(require)('modulePath') will work exactly as this module does, so the API is a drop in replacement.
Proxy can be made to respond correctly to typeof (import-lazy will always report 'function' regardless of the proxied object).
Support for revocable proxies.
It has a fun name.
Obviously not all of those are applicable to the goal of lazy importing, but there are a few items worth porting here at a minimum.
The text was updated successfully, but these errors were encountered:
While not my intention when initially creating
laxy
, it ended up being a drop in replacement for this module.It has a few key advantages:
It's a more generalized Proxy generator. Allowing for any generator function (not just
require
), and allows passing any number of arguments.It implements much more of the Proxy API. Allowing things like
Object.keys
,Object.getPrototypeOf
, setting values, and reflecting on property descriptors of the underlying object, etc.laxy(require)('modulePath')
will work exactly as this module does, so the API is a drop in replacement.Proxy can be made to respond correctly to
typeof
(import-lazy
will always report'function'
regardless of the proxied object).Support for revocable proxies.
It has a fun name.
Obviously not all of those are applicable to the goal of lazy importing, but there are a few items worth porting here at a minimum.
The text was updated successfully, but these errors were encountered: