UNPKG

citizenship_app_news

Version:

News module for Citizenship project application

25 lines (22 loc) 488 B
let _toast; /** * Set toast ref in main component * @param {JSXElement} toastRef */ function setToastRef(toastRef) { console.log('Abbas ref toast ', toastRef) _toast = toastRef; } /** * Show toast - Default duration = 2000 ms * @param {String} text * @param {number} duration */ function showToast(text, duration = 2000) { console.log('Show', _toast) _toast.showToast(text, duration) } export default { setToastRef, showToast }