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

merge parent route meta with children route meta #242

Merged
merged 3 commits into from
Aug 18, 2024
Merged

Conversation

stackoverfloweth
Copy link
Contributor

This PR updates createRoute utility to use a new combineMeta to merge child meta with parent (if parent exists). This follows the pattern used for state (and others). Merging meta is just a bit unique in that duplicate keys are allowed as long as the child's property of the same name matches typeof for the parent. The thinking here being that the child can override the meta property of a parent.

This PR also adds a new test suite for createRoute, with tests for new meta functionality as well as combine logic for other parts of the route.

Copy link

netlify bot commented Aug 14, 2024

Deploy Preview for kitbag-router ready!

Name Link
🔨 Latest commit c1cf6e9
🔍 Latest deploy log https://app.netlify.com/sites/kitbag-router/deploys/66bfae0354ece0000836c741
😎 Deploy Preview https://deploy-preview-242--kitbag-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stackoverfloweth stackoverfloweth mentioned this pull request Aug 14, 2024
Copy link
Contributor

@pleek91 pleek91 left a comment

Choose a reason for hiding this comment

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

Nice, this looks great

src/services/createRoute.spec.ts Outdated Show resolved Hide resolved
@stackoverfloweth stackoverfloweth merged commit c0e5f59 into main Aug 18, 2024
7 checks passed
@stackoverfloweth stackoverfloweth deleted the meta-merging branch August 18, 2024 02:15
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.

2 participants