Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider laxy #13

Open
jamestalmage opened this issue Dec 12, 2017 · 0 comments
Open

Consider laxy #13

jamestalmage opened this issue Dec 12, 2017 · 0 comments

Comments

@jamestalmage
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant