reactjrx 1.142.4 → 1.143.0

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,31 @@
1
1
  import { SubscribeSource } from './useSubscribe/types';
2
- interface Option {
3
- retryOnError?: boolean;
2
+ export interface UseSubscribeEffectOptions {
3
+ /**
4
+ * Called on every error of the source, including the ones that are
5
+ * retried.
6
+ */
4
7
  onError?: (error: unknown) => void;
8
+ /**
9
+ * Whether to subscribe to the source again after an error:
10
+ * - `false` (default): the error ends the subscription;
11
+ * - `true`: retry without limit;
12
+ * - a number: retry at most that many times in a row;
13
+ * - a function: given the attempt (0 for the first retry) and the error,
14
+ * returns whether to retry.
15
+ *
16
+ * The attempt count goes back to 0 once the source emits again.
17
+ */
18
+ retry?: boolean | number | ((attempt: number, error: unknown) => boolean);
19
+ /**
20
+ * Time to wait before each retry, in milliseconds, or a function of the
21
+ * attempt and the error. Retries always wait for a timer, so they never
22
+ * run synchronously, even with `0`. Defaults to an exponential backoff:
23
+ * 1 s, 2 s, 4 s… up to 30 s.
24
+ */
25
+ retryDelay?: number | ((attempt: number, error: unknown) => number);
5
26
  }
6
- export declare function useSubscribeEffect<T>(source: SubscribeSource<T>, options?: Option): void;
7
- export {};
27
+ /**
28
+ * Subscribes to `source` while the component is mounted. Options are read
29
+ * at each error, so changing them never subscribes again.
30
+ */
31
+ export declare function useSubscribeEffect<T>(source: SubscribeSource<T>, options?: UseSubscribeEffectOptions): void;
@@ -36,6 +36,6 @@ export declare const Context: import('react').Context<QueryClient$ | undefined>;
36
36
  export declare const QueryClientProvider$: import('react').MemoExoticComponent<({ children, client: _client, }: {
37
37
  children: React.ReactNode;
38
38
  client?: QueryClient$;
39
- }) => import("react/jsx-runtime").JSX.Element>;
39
+ }) => import('react').JSX.Element>;
40
40
  export declare const useQueryClient$: () => QueryClient$;
41
41
  export {};
@@ -2,4 +2,4 @@ import { DefaultError, QueryClient, QueryKey, UseQueryOptions } from '@tanstack/
2
2
  import { ObservableQueryFn } from './createObservableQueryFn';
3
3
  export declare function useQuery$<TQueryFnData = unknown, TError = DefaultError, TData = TQueryFnData, TQueryKey extends QueryKey = QueryKey>({ queryFn, ...options }: Omit<UseQueryOptions<TQueryFnData, TError, TData, TQueryKey>, "queryFn"> & {
4
4
  queryFn: ObservableQueryFn<TQueryFnData, TQueryKey>;
5
- }, queryClient?: QueryClient): import('@tanstack/react-query').UseQueryResult<NoInfer<TData>, TError>;
5
+ }, queryClient?: QueryClient): import('@tanstack/react-query').UseQueryResult<TData, TError>;
@@ -4,6 +4,6 @@ export type SignalContextType = SignalContext;
4
4
  export declare const SignalReactContext: import('react').Context<SignalContext>;
5
5
  export declare const SignalContextProvider: import('react').MemoExoticComponent<({ children }: {
6
6
  children: React.ReactNode;
7
- }) => import("react/jsx-runtime").JSX.Element>;
7
+ }) => import('react').JSX.Element>;
8
8
  export declare const useSignalContext: () => SignalContext;
9
9
  export declare const useMakeOrRetrieveSignal: (virtualSignal?: VirtualSignal<unknown>) => import('../Signal').Signal<unknown, undefined> | undefined;
@@ -17,4 +17,4 @@ export declare function createLiveQuerySource(initialItems: string[]): {
17
17
  };
18
18
  export declare function createWrapper(queryClient: QueryClient): ({ children }: {
19
19
  children: React.ReactNode;
20
- }) => import("react/jsx-runtime").JSX.Element;
20
+ }) => React.JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reactjrx",
3
3
  "private": false,
4
- "version": "1.142.4",
4
+ "version": "1.143.0",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"
@@ -39,7 +39,7 @@
39
39
  "rxjs": "*"
40
40
  },
41
41
  "devDependencies": {
42
- "@biomejs/biome": "2.4.15",
42
+ "@biomejs/biome": "2.5.15",
43
43
  "@rolldown/plugin-babel": "^0.2.3",
44
44
  "@tanstack/react-query-persist-client": "^5.96.2",
45
45
  "@testing-library/jest-dom": "^7.0.0",