UNPKG

234 BJavaScriptView Raw
1export default (context, inject) => {
2 const hooks = [];
3
4 const init = async hook => {
5 if (hook) {
6 hooks.push(hook);
7 return;
8 }
9
10 await Promise.all(hooks.map(hook => hook()));
11 };
12
13 inject('init', init);
14};