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

Enhance API for multiple feeds #1548

Merged
merged 1 commit into from Jul 19, 2017
Merged

Enhance API for multiple feeds #1548

merged 1 commit into from Jul 19, 2017

Conversation

secretfader
Copy link

This enhances the feeds plugin API when defining multiple feeds, but also keeps sensible defaults.

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 90e1c5a78361b3c56355c3c6aac843b832887ea3

https://deploy-preview-1548--using-drupal.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 90e1c5a78361b3c56355c3c6aac843b832887ea3

https://deploy-preview-1548--gatsbyjs.netlify.com

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 19, 2017

Deploy preview ready!

Built with commit 50ed083

https://deploy-preview-1548--using-drupal.netlify.com

// https://stackoverflow.com/questions/13852852/surely-es6-must-have-a-way-to-merge-two-javascript-objects-together-what-is-it
const isObject = item => item && typeof item === 'object' && !Array.isArray(item)

export function mergeDeep(target, ...sources) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to use the lodash function?

Copy link
Author

Choose a reason for hiding this comment

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

If that's preferable, cool. I don't care either way. No other reason besides this doesn't pull in a library for one function.

Copy link
Contributor

Choose a reason for hiding this comment

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

Lodash is used in the core Gatsby package as well as in many of the other plugins which makes it effectively "free" for you to use here.

const ctx = { ...globals, ...locals }
const feed = new RSS(setup({ ...rest, ...ctx }))
const items = f.serialize ? f.serialize(ctx) : serialize(ctx)
console.log(locals)
Copy link
Contributor

Choose a reason for hiding this comment

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

Extra console.log

Copy link
Author

Choose a reason for hiding this comment

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

Good catch. I should probably standardize on the debug module for things like this.

@gatsbybot
Copy link
Collaborator

gatsbybot commented Jul 19, 2017

Deploy preview ready!

Built with commit 50ed083

https://deploy-preview-1548--gatsbyjs.netlify.com

@gatsbybot
Copy link
Collaborator

Deploy preview ready!

Built with commit 90e1c5a78361b3c56355c3c6aac843b832887ea3

https://deploy-preview-1548--gatsbygram.netlify.com

@KyleAMathews
Copy link
Contributor

KyleAMathews commented Jul 19, 2017

Deploy preview ready!

Built with commit 50ed083

https://deploy-preview-1548--gatsbygram.netlify.com

@secretfader
Copy link
Author

@KyleAMathews The issues you mentioned should be resolved now.

@secretfader
Copy link
Author

Actually, hold up. I have one more change to go in.

@secretfader
Copy link
Author

👍 Okay, ready to go. @KyleAMathews

@KyleAMathews
Copy link
Contributor

Deploy preview failed.

Built with commit af44327fbeed412f975459eb55408278accdda11

https://app.netlify.com/sites/using-remark/deploys/596ed8416f4c501fa84cd31f

@KyleAMathews
Copy link
Contributor

👍

@KyleAMathews KyleAMathews merged commit 4ca06f8 into gatsbyjs:master Jul 19, 2017
@secretfader secretfader deleted the feature/enhanced-feed-plugin branch July 19, 2017 11:31
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.

None yet

3 participants