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

easy fixes #1325

Closed
wants to merge 1 commit into from
Closed

easy fixes #1325

wants to merge 1 commit into from

Conversation

rmfarrell
Copy link
Contributor

@rmfarrell rmfarrell commented Sep 6, 2018

Depends on #1324

@rmfarrell rmfarrell changed the base branch from master to list-collapse September 6, 2018 15:18
@@ -167,8 +168,6 @@ export function hasPlaceholder(uri, path, storeOverride = store) {
isCollapsibleList = isComponentList && !!_.get(schema, `${componentListProp}.collapse`),
isComponentProp = schema && !!schema[componentProp];

// if there isn't a placeholder at all, return negative quickly
// since we're ususally checking a bunch of fields/groups
if (!placeholder) {
return false;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

no explanation needed for early returns because they're the best. It's so much nicer reserving your unindented code for your main logical branch and your indented code for early returns, error handling, etc.

@rmfarrell rmfarrell changed the title some easy code wins easy fixes Sep 6, 2018
_.each(placeholders[uri], (placeholder) => placeholder.$destroy());
placeholders[uri] = null;
}
placeholders[uri] && placeholders[uri].forEach((ph) => ph.$destroy());
Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't remove / nullify placeholders[uri]

Copy link
Contributor

@nelsonpecora nelsonpecora left a comment

Choose a reason for hiding this comment

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

I'm not quite sure what these are fixing, but (aside from the removal code) they seem fine

@rmfarrell rmfarrell closed this Sep 7, 2018
@rmfarrell rmfarrell deleted the placeholders-cleanup branch September 7, 2018 13:58
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

Successfully merging this pull request may close these issues.

None yet

2 participants