-
Notifications
You must be signed in to change notification settings - Fork 2.4k
🔨 Switch Live to use useOvermind #3063
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
Conversation
|
Build for latest commit a8c21c2 is at https://pr3063.build.csb.dev/s/new. |
packages/app/src/app/pages/Sandbox/Editor/Workspace/items/Live/index.tsx
Show resolved
Hide resolved
| export const createLiveClicked: AsyncAction<{ | ||
| sandboxId: string; | ||
| }> = async ({ state, effects, actions }, { sandboxId }) => { | ||
| export const createLiveClicked: AsyncAction<string> = async ( |
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.
Interesting, wouldn't this be less explicit (eg. I now need to know what's passed by going to the function call) and scalable (what if we want to add another option)? What's your opinion on this @christianalfoni?
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 did this in recommendation of @christianalfoni in an earlier PR, but can't find it anywhere tho 😕
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.
Yeah, I remember this was christian idea in new code as it makes it cleaner
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.
Yeah @christianalfoni said we should defo do it in new code.
But if I wanted, I could refactor them on the go
Can't find the comment where he said that anymore tho.
Too many PRs 😂😇
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.
Ah, yeah, there is no reason to pass an object anymore to actions. It was a requirement in Cerebral.
You could argue that the typing does not explicitly say sandboxId anymore, but payload. I just favour reduced syntax as if you were to write this action from scratch you would type it with string, because of our lazyness as developers 😂
68032d3 to
551716f
Compare
35aab7e to
499599e
Compare
75bd79c to
422a361
Compare
422a361 to
a8c21c2
Compare
|
@CompuIves Can you please review this? |
CompuIves
left a comment
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.
That makes sense, this looks good to me! Let's merge it if you've tested the component 😄.
Thanks for this conversion!
|
YAY! All looks good to me too! Thank you! |
|
With pleasure! 🙂 |
Follow-up of #2663
Things I did extra:
createLiveClicked's signature to accept astringinstead of{ sandboxId: string }, because it only has 1 argumentonChatEnabledChange's signature to accept abooleaninstead of{ enabled: boolean }, because it only has 1 argumentFragment(<></>)