UNPKG

731 BTypeScriptView Raw
1import { EventLike } from "./frombinder";
2import { EventStream } from "./observable";
3/**
4 * A polled function used by [fromPoll](../globals.html#frompoll)
5 */
6export declare type PollFunction<V> = () => EventLike<V>;
7/**
8 Polls given function with given interval.
9 Function should return Events: either [`Bacon.Next`](classes/next.html) or [`Bacon.End`](classes/end.html). Polling occurs only
10 when there are subscribers to the stream. Polling ends permanently when
11 `f` returns [`Bacon.End`](classes/end.html).
12 * @param delay poll interval in milliseconds
13 * @param poll function to be polled
14 * @typeparam V Type of stream elements
15 */
16export default function fromPoll<V>(delay: number, poll: PollFunction<V>): EventStream<V>;