-
Notifications
You must be signed in to change notification settings - Fork 263
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
feat: useStepTransition #4361
Conversation
Introduce new hook to dispatch the transition request
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
export interface StepTransitionPayload { | ||
fromStep: string; | ||
toStep: string | null; | ||
transitionEvent: string; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are stepInputs?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @rebelchris
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok fixed!
Introduce new hook to dispatch the transition request
MI-858 #done
Jira ticket
MI-858
Preview domain
https://mi-858.preview.app.daily.dev