(update: SystemReading<T> | ((previous: SystemReading<T>) => SystemReading<T>))
| 15 | |
| 16 | useEffect(() => { |
| 17 | const setReading = (update: SystemReading<T> | ((previous: SystemReading<T>) => SystemReading<T>)) => { |
| 18 | setOwned(previous => { |
| 19 | const current = previous.owner === read ? previous.reading : { data: null, updatedAt: null, error: null, loading: false }; |
| 20 | return { owner: read, reading: typeof update === 'function' ? update(current) : update }; |
| 21 | }); |
| 22 | }; |
| 23 | let disposed = false; |
| 24 | let generation = 0; |
| 25 | let timer: ReturnType<typeof setTimeout> | undefined; |
no outgoing calls
no test coverage detected