Skip to content

Implement a way to get data on Head and Page from a single database query #44639

Answered by sebmarkbage
Josehower asked this question in Help
Discussion options

You must be logged in to vote

You can use cache from react to create a function that's deduped.

import {cache} from "react";

const getPageInfoFromDatabase = cache(function getPageInfoFromDatabase() {

});

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@karlhorky
Comment options

Answer selected by balazsorban44
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #44595 on January 06, 2023 08:34.