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

Changed Toast init to notify #4026

Merged
merged 5 commits into from
Nov 26, 2023
Merged

Changed Toast init to notify #4026

merged 5 commits into from
Nov 26, 2023

Conversation

joshLumpkin
Copy link
Contributor

Fixes #4024

Description

added an alias for init, in the toast feature. you can now use notify instead of init. Init is still retained and marked with depreciated.

Also updated docs to use the new notify instead of init.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x ] Improvement/refactoring (non-breaking change that doesn't add any feature but make things better)

Copy link
Member

@asvae asvae left a comment

Choose a reason for hiding this comment

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

Hey, thanks!

One small thing I mentioned and we can merge!

@@ -18,6 +19,10 @@ export const useToast = () => {
return id
}

const notify = (options: string | NotificationOptions) => {
Copy link
Member

Choose a reason for hiding this comment

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

It probably should be another way round.

init should call notify :)

so that when notify is used - no deprecation warnings will happen

and when init is used - deprecation warning would happen

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah, good point. updating PR now

@joshLumpkin joshLumpkin requested a review from asvae November 24, 2023 18:36
@joshLumpkin
Copy link
Contributor Author

Requested review, let me know if any other changes are needed! Trying to contribute more frequently!

Copy link
Collaborator

@m0ksem m0ksem left a comment

Choose a reason for hiding this comment

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

I'm okay with JSDocs deprecation warning instead of console.warn, we can forget about init method for few minor versions.

@m0ksem m0ksem merged commit 8097dbb into epicmaxco:develop Nov 26, 2023
1 check passed
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.

Let's add alias to useToast init function
3 participants