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

implement attribute function #277

Merged
merged 3 commits into from
Apr 3, 2019

Conversation

salzhrani
Copy link
Contributor

Summary

Allow the attributes arguments to be a function to possibly map the chunks to attributes.

Currently it uses the same argument but checks if it is a function or an object.

Also the attribute function could get null as an argument in case the __LOADABLE_REQUIRED_CHUNKS__ tag

Looking forward to your feedback.

Test plan

tests included

Copy link
Owner

@gregberge gregberge left a comment

Choose a reason for hiding this comment

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

Good work! Just a small change!

extraProps,
)}>${this.getRequiredChunksScriptContent()}</script>`
}

getRequiredChunksScriptElement(extraProps) {
getRequiredChunksScriptElement(asset, extraProps) {
Copy link
Owner

Choose a reason for hiding this comment

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

I don't understand this change. Why changing this signature, you can just call handleExtraProps(null, extraProps).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you are correct

Copy link
Owner

@gregberge gregberge left a comment

Choose a reason for hiding this comment

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

Thanks! Could you add some documentation @salzhrani about the new feature on the website?

@gregberge
Copy link
Owner

@salzhrani any news?

@salzhrani
Copy link
Contributor Author

@neoziro I just added some documentation.

@gregberge
Copy link
Owner

@salzhrani thanks, one last thing, could you rebase please?

@salzhrani salzhrani force-pushed the attribute-function branch from 5557baf to 008084b Compare March 29, 2019 12:16
@salzhrani
Copy link
Contributor Author

rebased

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