@cnamts/vue-dot
Version:
Implementation of our Design System for the French Health Insurance
17 lines (11 loc) • 392 B
text/typescript
import { Commit } from 'vuex';
import { NotificationState, NotificationObj } from './types';
/** Commit mutation to add a notification */
export function notify(commit: Commit, state: NotificationState, notification: NotificationObj): void {
if (state.notification) {
commit('CLEAR');
setTimeout(() => commit('ADD', notification), 250);
return;
}
commit('ADD', notification);
}