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

code refactoring for container package #14989

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions packages/container/lib/container.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,7 @@ function lookup(container, fullName, options = {}) {
}

function isSingletonClass(container, fullName, { instantiate, singleton }) {
return (singleton !== false && isSingleton(container, fullName)) &&
(instantiate === false && !shouldInstantiate(container, fullName));
return singleton !== false && isSingleton(container, fullName) && !instantiate && !shouldInstantiate(container, fullName);
}

function isSingletonInstance(container, fullName, { instantiate, singleton }) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically want to avoid lines that are too long. I also feel the former is easier to read

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking at this pull request. Should I replace it?

Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.