-
Notifications
You must be signed in to change notification settings - Fork 15
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
IBX-2277: [Taxonomy] As a user, I want to change language context in Taxonomy Tree #319
IBX-2277: [Taxonomy] As a user, I want to change language context in Taxonomy Tree #319
Conversation
@@ -0,0 +1,17 @@ | |||
(function(global, doc, ibexa) { | |||
const set = (domElement, instance) => { |
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.
I'm not sure, but I would probably prefer more verbose names e.g. setInstance
etc. given these are functions and not object methods. WDYT? 🤔
const set = (domElement, instance) => { | ||
domElement.ibexaInstance = instance; | ||
} | ||
const get = (domElement) => { |
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.
Not sure whether we need to implement it right now, but... now it is not possible to check whether the given dom element has instance assigned without catching the error and checking its message.
Why not just return undefined
when there is not instance assigned?
I think the guidance here may be get
method from Map
which does just that.
ref. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/get
@@ -6,6 +6,8 @@ | |||
container: dropdownContainer, | |||
}); | |||
|
|||
dropdownContainer.instance = dropdown; |
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.
Why you are not using helper here?
b72a9d9
to
01efa4c
Compare
01efa4c
to
f73b730
Compare
Checklist:
$ composer fix-cs
)