♻️ (notif) add queue notif service to lazy load notif lib

This commit is contained in:
Julien Calixte
2020-04-11 00:53:27 +02:00
parent 8a76042625
commit b79569102d
19 changed files with 1280 additions and 1012 deletions

View File

@@ -0,0 +1,29 @@
<template>
<span class="queue-notif"></span>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'
import queueNotifService from '@/services/QueueNotifService'
import notif from '@/utils/notif'
@Component
export default class QueueNotif extends Vue {
public mounted() {
queueNotifService.subscribe((notification) => {
switch (notification.type) {
case 'success':
notif.success(notification.message)
break
case 'error':
notif.error(notification.message)
break
}
})
}
public beforeDestroy() {
queueNotifService.unsubscribe()
}
}
</script>