Commit af6893e4 by Fabien Wernli Committed by GitHub

Fix documentation for streaming data sources (#30704)

The added code is now mandatory since 7.4.x
See https://github.com/grafana/grafana/issues/30686
parent 0a8eae2c
......@@ -76,12 +76,17 @@ Grafana uses [RxJS](https://rxjs.dev/) to continuously send data from a data sou
1. Use `subscriber.next()` to send the updated data frame whenever you receive new updates.
```ts
import { LoadingState } from '@grafana/data';
```
```ts
const intervalId = setInterval(() => {
frame.add({ time: Date.now(), value: Math.random() });
subscriber.next({
data: [frame],
key: query.refId,
state: LoadingState.Streaming,
});
}, 500);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment