How to define global function 【Javascript】
Mar 13, 2022
--
We sometimes want to develop global function which is common in software. For example, it is a function that notifies users of errors. In that case, we can use window object.
import notify from 'path/to/notify'window.notify = notifyfunction a () {
notify()
}
function b () {
notify()
}