(key, update)
| 13 | }); |
| 14 | |
| 15 | export default function hookSetting(key, update) { |
| 16 | options.ready.then(() => update(options.get(key))); |
| 17 | const list = hooks[key] || (hooks[key] = []); |
| 18 | list.push(update); |
| 19 | return () => { |
| 20 | const i = list.indexOf(update); |
| 21 | if (i >= 0) list.splice(i, 1); |
| 22 | }; |
| 23 | } |
no test coverage detected