Skip to content

feat: useStepTransition #4361

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

Merged
merged 3 commits into from
Apr 9, 2025
Merged

feat: useStepTransition #4361

merged 3 commits into from
Apr 9, 2025

Conversation

idoshamun
Copy link
Member

@idoshamun idoshamun commented Apr 8, 2025

Introduce new hook to dispatch the transition request

MI-858 #done

Jira ticket

MI-858

Preview domain

https://mi-858.preview.app.daily.dev

Introduce new hook to dispatch the transition request
@idoshamun idoshamun requested a review from a team as a code owner April 8, 2025 14:06
@idoshamun idoshamun requested review from rebelchris, omBratteng, ilasw, capJavert, sshanzel, nensidosari and AmarTrebinjac and removed request for a team April 8, 2025 14:06
Copy link

vercel bot commented Apr 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
daily-webapp ✅ Ready (Inspect) Visit Preview Apr 9, 2025 7:12am
storybook 🔄 Building (Inspect) Visit Preview Apr 9, 2025 7:12am

export interface StepTransitionPayload {
fromStep: string;
toStep: string | null;
transitionEvent: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can use FunnelStepTransitionType?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

fromStep: string;
toStep: string | null;
transitionEvent: string;
inputs?: StepInputs;
Copy link
Contributor

Choose a reason for hiding this comment

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

What are stepInputs?

Copy link
Member Author

Choose a reason for hiding this comment

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

This can be the answer of a quiz, the selected pricing, or any other info we want to store


export type UseStepTransitionRet = {
transition: UseMutateAsyncFunction<void, HttpError, StepTransitionPayload>;
isLoading: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think at some point we agreed to use isPending instead of isLoading as a general rule. Not sure how much we enforce it still

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

If it's a react-query mimic yeah we should use isPending.
They are 2 different thing, but the previous isLoading is now isPending.

Copy link
Member Author

Choose a reason for hiding this comment

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

I am using isPending, just renamed it to isLoading as you can see below

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but what I meant is that we agreed to use the isPending name, not isLoading on a project level 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

ok fixed!

@idoshamun idoshamun merged commit b4c7e12 into feat-web-funnel Apr 9, 2025
10 checks passed
@idoshamun idoshamun deleted the MI-858 branch April 9, 2025 07:32
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.

4 participants