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

Custom preloads with multiple keys #133

Merged
merged 3 commits into from Dec 14, 2023

Conversation

apauly
Copy link
Contributor

@apauly apauly commented Dec 13, 2023

Hi,

the idea of this PR is to allow custom preloads with multiple keys without adding a dedicated method for the the combined key.

In order to do so, you can just pass an array of symbols as the key: argument. Instead of passing a plain array of ids to the block, we would collect an array of keys for each record and pass the 2 dimensional array to the block.

This is 100% backwards compatible.

@apauly apauly requested review from jturkel and a team as code owners December 13, 2023 19:52
Copy link
Member

@jturkel jturkel left a comment

Choose a reason for hiding this comment

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

Nice improvement! One small comment on the code sample but otherwise looks great.

README.md Outdated Show resolved Hide resolved
Copy link
Member

@jturkel jturkel left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution 🎉

@jturkel jturkel merged commit 02c517d into salsify:master Dec 14, 2023
2 checks passed
@jturkel jturkel mentioned this pull request Dec 14, 2023
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

2 participants