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

Simplify useRenderCampaigns #89

Merged
merged 10 commits into from
Jul 22, 2024
Merged

Simplify useRenderCampaigns #89

merged 10 commits into from
Jul 22, 2024

Conversation

timowestnosto
Copy link
Contributor

@timowestnosto timowestnosto commented Jul 22, 2024

Extracts useRenderCampaigns out of the main context and reduces the rerun conditions for the Session API side effects

@@ -38,7 +36,8 @@ export default function NostoOrder(props: {
.load()
renderCampaigns(data, api)
},
[recommendationComponent, pageTypeUpdated]
[order],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

order was missing

renderCampaigns(data: unknown, api: NostoClient): void
pageTypeUpdated: boolean
}
pageType: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not anymore used

recommendationComponent?: React.ReactElement<{
nostoRecommendation: Recommendation
}>
useRenderCampaigns(type: string): {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to standalone hook that uses context internally

@timowestnosto timowestnosto force-pushed the use-render-campaigns branch from ca470a9 to fcbbc48 Compare July 22, 2024 08:29
@timowestnosto timowestnosto force-pushed the use-render-campaigns branch from 1d5f133 to 35c0872 Compare July 22, 2024 08:55
@timowestnosto timowestnosto merged commit bd65e2b into master Jul 22, 2024
1 check passed
@timowestnosto timowestnosto deleted the use-render-campaigns branch July 22, 2024 12:22
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