ngx-lift 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,20 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { AsyncState } from '../models';
3
3
  /**
4
- * Polls the API at a specified interval, handling the triggering of requests and building parameters.
4
+ * Polls data at a specified interval and can be triggered manually.
5
5
  *
6
- * @param {Object} options - The options object containing interval, apiCall, paramsBuilder, and trigger
7
- * @param {number} options.interval - The interval at which to poll the API
8
- * @param {(params: Record<string, unknown>) => Observable<Data>} options.apiCall - The function to call the API
9
- * @param {(input: Input | null) => Record<string, unknown>} [options.paramsBuilder] - The function to build parameters based on input
10
- * @param {Observable<Input>} [options.trigger] - The trigger observable for initiating requests
11
- * @return {Observable<AsyncState<Data>>} An observable emitting the async state of the API data
6
+ * @template Data - The type of the data emitted by the polling function.
7
+ * @template Input - The type of the input parameter used to build polling parameters.
8
+ * @param {object} options - The configuration options for polling.
9
+ * @param {number} options.interval - The interval in milliseconds between each poll.
10
+ * @param {(params: any) => Observable<Data>} options.pollingFn - A function that returns an Observable emitting the polled data.
11
+ * @param {(input: Input | null) => any} [options.paramsBuilder] - An optional function that builds parameters for the polling function based on the input.
12
+ * @param {Observable<Input>} [options.trigger] - An optional Observable that triggers a manual poll.
13
+ * @returns {Observable<AsyncState<Data>>} An Observable emitting objects representing the state of the asynchronous operation.
12
14
  */
13
15
  export declare function poll<Data, Input>(options: {
14
16
  interval: number;
15
- apiCall: (params: Record<string, unknown>) => Observable<Data>;
16
- paramsBuilder?: (input: Input | null) => Record<string, unknown>;
17
+ pollingFn: (params: any) => Observable<Data>;
18
+ paramsBuilder?: (input: Input | null) => any;
17
19
  trigger?: Observable<Input>;
18
20
  }): Observable<AsyncState<Data>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-lift",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "A project has been crafted with the goal of enhancing and simplifying your Angular development experience.",
5
5
  "author": "Guanghui Wang <guanghui-wang@foxmail.com>",
6
6
  "peerDependencies": {