Skip to content

Commit

Permalink
#20 fix toastChanged event initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
artemsky committed May 17, 2018
1 parent 6905ac1 commit e638c6a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions example/src/App/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,15 @@ export class App extends Vue {
More information how to work with observables:
https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/create.md
*/
const {timeout, ...config} = this.getConfig(); // Omit timeout
const config = this.getConfig(); // Omit timeout
this.$snotify.async('Called with promise', 'Error async', () => new Promise((resolve, reject) => {
setTimeout(() => reject({
title: 'Error!!!',
body: 'We got an example error!',
config: {
closeOnClick: true
...config,
closeOnClick: true,
timeout: 8000
}
}), 2000);
}));
Expand All @@ -103,6 +105,7 @@ export class App extends Vue {
title: 'Success!!!',
body: 'We got an example success!',
config: {
...config,
closeOnClick: true
}
}), 2000);
Expand Down
1 change: 1 addition & 0 deletions src/SnotifyService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ export class SnotifyService {
toast.config.html = next.html;
}
this.emit();
this.emitter.$emit('toastChanged', toast);
}

/**
Expand Down

0 comments on commit e638c6a

Please sign in to comment.