Skip to content

Commit

Permalink
fix: no need to clear instance
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jun 24, 2019
1 parent 77cf6fe commit 934adeb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export class Snackbar {
const { el, wrapper } = this
if (el) {
this.el = undefined
instances.splice(instances.indexOf(this), 1)
// Transition the snack away.
el.setAttribute('aria-hidden', 'true')
await new Promise(resolve => {
Expand Down Expand Up @@ -212,8 +211,5 @@ export function createSnackbar(message: string, options?: SnackOptions) {
}

export function destroyAllSnackbars() {
const cleanup = () => (instances = [])
return Promise.all(instances.map(instance => instance.destroy()))
.then(cleanup)
.catch(cleanup)
}

0 comments on commit 934adeb

Please sign in to comment.