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

breaking(plugin): Make publish generic over Message and not Message data #166

Merged
merged 1 commit into from Aug 19, 2022

Conversation

Steven0351
Copy link
Member

@Steven0351 Steven0351 commented Aug 18, 2022

This should allow for doing things like this:

type Messages = 
  | { topic: "cart:dismiss", data: "clear" | "cancel" }
  | { topic: "user:delete", data: User }

publish<Messages>({ topic: "cart:dismiss", data: "cancel" }) //totally fine
publish({ topic: "something:else", data: 1 }) // totally fine
publish<Messages>({ topic: "user:delete", data: "clear" }) // typescript error
publish<Messages>({ topic: "something:else", data: 1 }) // typescript error

Props to @eric-horodyski for the idea

@vercel
Copy link

vercel bot commented Aug 18, 2022

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

Name Status Preview Updated
ionic-portals ✅ Ready (Inspect) Visit Preview Aug 18, 2022 at 9:02PM (UTC)

@vercel vercel bot temporarily deployed to Preview August 18, 2022 21:02 Inactive
@Steven0351 Steven0351 marked this pull request as draft August 18, 2022 21:03
@Steven0351 Steven0351 changed the title breaking: Make publish generic over Message and not Message data breaking(plugin): Make publish generic over Message and not Message data Aug 18, 2022
@Steven0351 Steven0351 marked this pull request as ready for review August 18, 2022 21:18
Copy link
Member

@eric-horodyski eric-horodyski left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@giralte-ionic giralte-ionic left a comment

Choose a reason for hiding this comment

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

total fire here

Copy link
Member

@carlpoole carlpoole left a comment

Choose a reason for hiding this comment

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

nice!

@Steven0351 Steven0351 merged commit 6af8120 into main Aug 19, 2022
@eric-horodyski
Copy link
Member

Any idea when a release will be cut for this? Would like to communicate to customers and bump up demo project

@Steven0351
Copy link
Member Author

We could cut it at any time. Maybe today? We don't really have a regular release cadence for the projects so there is no tempo we usually go off of.

@eric-horodyski
Copy link
Member

@Steven0351 - Let me create a PR for doc updates and once it's merged we can publish?

@Steven0351
Copy link
Member Author

Sounds good to me

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.

None yet

4 participants