()
| 45 | |
| 46 | client?.on('Misc.GlobalVariableUpdated', ({ data }) => { |
| 47 | if ('name' in data && 'newValue' in data && 'lastWrite' in data && data.name === name) { |
| 48 | value.value = data.newValue as T; |
| 49 | lastWrite.value = data.lastWrite as string; |
| 50 | } |
| 51 | }); |
| 52 | }, |
| 53 | { immediate: true }, |
| 54 | ); |
| 55 | |
| 56 | async function fetch() { |
| 57 | const response = await client?.value?.getGlobal<T>(name, _options?.value.persisted !== false); |
| 58 | if (response?.status === 'ok' && response.variable) { |
no test coverage detected