Skip to content

Commit

Permalink
feat(toast): expose timeout to alias methods (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
  • Loading branch information
smarroufin and benjamincanac committed Feb 9, 2022
1 parent b7f6bf9 commit 6bd5197
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/runtime/plugins/toast.client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.provide('toast', {
addNotification,
removeNotification,
success ({ title, description }: { title?: string, description?: string } = {}) {
success ({ title, description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
addNotification({
type: 'success',
title,
description,
timeout: 4000
timeout
})
},
error ({ title = 'An error occurred!', description }: { title?: string, description?: string } = {}) {
error ({ title = 'An error occurred!', description, timeout }: { title?: string, description?: string, timeout?: number } = {}) {
addNotification({
type: 'error',
title,
description,
timeout: 4000
timeout
})
}
})
Expand Down

1 comment on commit 6bd5197

@vercel
Copy link

@vercel vercel bot commented on 6bd5197 Feb 9, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

Please sign in to comment.