react-terminal-viewer-cicd 2.0.5 → 2.0.7

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,7 +1,7 @@
1
1
  function LogWorker() {
2
2
  var workerPath = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '/worker';
3
3
  var worker = null;
4
- var version = "2.0.5" || '0.0.0';
4
+ var version = "2.0.7" || '0.0.0';
5
5
  var path = workerPath.includes('http') ? "".concat(workerPath, "/log.worker.js") : "".concat(window.location.origin).concat(workerPath, "/log.worker.js");
6
6
  var blob = new Blob(["importScripts(\"".concat(path, "?v=").concat(version, "\")")], {
7
7
  type: 'application/javascript'
@@ -7,6 +7,7 @@ export interface IRemoteOptions {
7
7
  timeout?: number;
8
8
  retry?: number;
9
9
  enableBatch?: boolean;
10
+ status?: boolean;
10
11
  }
11
12
  export type UseRemoteHooks = (defaultData: string, callback?: (string: string) => void, options?: IRemoteOptions | undefined, cacheOptions?: ICacheOptions) => {
12
13
  data: string;
@@ -20,7 +21,7 @@ export interface FetchResult {
20
21
  key?: string | number;
21
22
  nextKey?: string | number;
22
23
  }
23
- export declare const useSequenceFetch: (fetch: ((cacheValueKey?: string | number) => Promise<FetchResult>) | undefined, callback: (data: string) => Promise<void>, options: Pick<IRemoteOptions, 'timeout' | 'retry' | 'cacheKey' | 'cacheValueKey'>, cacheOptions?: ICacheOptions) => {
24
+ export declare const useSequenceFetch: (fetch: ((cacheValueKey?: string | number) => Promise<FetchResult>) | undefined, callback: (data: string) => Promise<void>, options: Pick<IRemoteOptions, 'timeout' | 'retry' | 'cacheKey' | 'cacheValueKey' | 'status'>, cacheOptions?: ICacheOptions) => {
24
25
  loading: boolean;
25
26
  setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
26
27
  refresh: () => Promise<void>;
@@ -106,6 +106,13 @@ export var useSequenceFetch = function useSequenceFetch(fetch, callback, options
106
106
  _useState4 = _slicedToArray(_useState3, 2),
107
107
  job = _useState4[0],
108
108
  setJob = _useState4[1];
109
+ useEffect(function () {
110
+ setJob({
111
+ fetch: fetch,
112
+ retry: typeof retry !== 'undefined' ? retry : 0,
113
+ timeout: 0
114
+ });
115
+ }, [fetch, retry]);
109
116
  useEffect(function () {
110
117
  optionsRef.current = {
111
118
  retry: retry,
@@ -232,7 +239,7 @@ export var useSequenceFetch = function useSequenceFetch(fetch, callback, options
232
239
  };
233
240
  }();
234
241
  execJob();
235
- }, [setCache, getCache, job]);
242
+ }, [setCache, getCache, job, options.status]);
236
243
  useEffect(function () {
237
244
  return function () {
238
245
  clearTimeout(timerRef.current);
@@ -7,6 +7,7 @@ export interface IRemoteOptions {
7
7
  timeout?: number;
8
8
  retry?: number;
9
9
  enableBatch?: boolean;
10
+ status?: boolean;
10
11
  }
11
12
  export type UseRemoteHooks = (defaultData: string, callback?: (string: string) => void, options?: IRemoteOptions | undefined, cacheOptions?: ICacheOptions) => {
12
13
  data: string;
@@ -20,7 +21,7 @@ export interface FetchResult {
20
21
  key?: string | number;
21
22
  nextKey?: string | number;
22
23
  }
23
- export declare const useSequenceFetch: (fetch: ((cacheValueKey?: string | number) => Promise<FetchResult>) | undefined, callback: (data: string) => Promise<void>, options: Pick<IRemoteOptions, 'timeout' | 'retry' | 'cacheKey' | 'cacheValueKey'>, cacheOptions?: ICacheOptions) => {
24
+ export declare const useSequenceFetch: (fetch: ((cacheValueKey?: string | number) => Promise<FetchResult>) | undefined, callback: (data: string) => Promise<void>, options: Pick<IRemoteOptions, 'timeout' | 'retry' | 'cacheKey' | 'cacheValueKey' | 'status'>, cacheOptions?: ICacheOptions) => {
24
25
  loading: boolean;
25
26
  setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
26
27
  refresh: () => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-terminal-viewer-cicd",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "author": "https://gitee.com/gitee-frontend",
5
5
  "license": "MIT",
6
6
  "keywords": [