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

feat(features): Features as an option #555

Merged
merged 3 commits into from
Aug 19, 2020

Conversation

ConradJChan
Copy link
Contributor

@ConradJChan ConradJChan requested a review from a team as a code owner August 18, 2020 23:42
jstoffan
jstoffan previously approved these changes Aug 19, 2020
@@ -123,6 +132,10 @@ export default class BaseAnnotator extends EventEmitter {
this.store.dispatch(store.setIsInitialized());
}

public isFeatureEnabled(feature = ''): boolean {
return getProp(this.features, feature, false);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does something like return this.features?.[feature] || false work here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps, but I figure getProp could be more flexible for nesting of features?

src/common/BaseAnnotator.ts Outdated Show resolved Hide resolved
@ConradJChan ConradJChan merged commit d75c483 into box:master Aug 19, 2020
@ConradJChan ConradJChan deleted the annotations-features branch August 19, 2020 17:28
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.

3 participants