-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
feat: add getModule and getContainer to utilities #476
feat: add getModule and getContainer to utilities #476
Conversation
if (!modFactory) return undefined; | ||
const mod = modFactory(); | ||
if (exportName) { | ||
return mod && typeof mod === 'object' ? mod[exportName] : undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use optional chaining and nullish coalescing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ExProbitasFiducia in fact i only had isolate the source code and bring to the utilities, i haven't develop the code 😅
@ScriptedAlchemy using optional chaining and nullish coalescing here would have the same effect or you had avoided to use because you've found any problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See if it compiles down to ES5 or not, if it keeps the modern syntax then id avoid using it since it will break some browsers / node versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It *should* according to this SO post, but it could be down to config; it depends what the target we're compiling to is. If we're targeting es5 in our config then it ought to work though; full disclosure I have not checked that nor have I looked at the config.
Lint fail in CI |
…iverse into feat/get-module-to-utilities
@ScriptedAlchemy i merge and fix conflicts and run nx lint now 🙏🏻 |
As state at the discussion #399