-
Notifications
You must be signed in to change notification settings - Fork 0
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
getOptions > refactor code for reuse through multiple ESLibs #10
Conversation
I have forked this repository and created PR from it. So I can't set the assignee or reviewer for this PR. Sorry about that! |
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.
Make sure getOptions
is identical to the merged version from Easy Tab Accordion.
src/helpers.js
Outdated
if(attributeIsNotJSON){ | ||
options = defaultOptions; | ||
|
||
// data attribute exist => string | ||
if(dataAttribute) options.id = dataAttribute; | ||
else options.id = ''; |
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 have added a small condition to remove the id
from default options (for getting the id with the right priority below purpose).
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.
LGTM.
Write the same
getOptions
function for making our code reusable and using through multiple ES Libraries (or any library that needs to get options from data-attribute) :With the new
getOptions
function, we can get options and override them for each library option through data-attribute