react-rx 4.1.5 → 4.1.6

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.
package/dist/index.cjs CHANGED
@@ -13,21 +13,14 @@ function useObservable(observable, initialValue) {
13
13
  didEmit: !1
14
14
  }, entry = {
15
15
  state,
16
- observable: observable.pipe(operators.map((value) => ({
17
- snapshot: value,
18
- error: void 0
19
- })), rxjs.catchError((error) => rxjs.of({
20
- snapshot: void 0,
21
- error
22
- })), operators.tap((t12) => {
16
+ observable: observable.pipe(operators.map(_temp$1), rxjs.catchError(_temp2), operators.tap((t12) => {
23
17
  const {
24
18
  snapshot,
25
19
  error: error_0
26
20
  } = t12;
27
21
  state.didEmit = !0, state.snapshot = snapshot, state.error = error_0;
28
- }), operators.map((value_0) => {
29
- }), rxjs.finalize(() => cache.delete(observable)), rxjs.share({
30
- resetOnRefCountZero: () => rxjs.timer(0, rxjs.asapScheduler)
22
+ }), operators.map(_temp3), rxjs.finalize(() => cache.delete(observable)), rxjs.share({
23
+ resetOnRefCountZero: _temp4
31
24
  })),
32
25
  getSnapshot: (initialValue_0) => {
33
26
  if (state.error)
@@ -53,6 +46,23 @@ function useObservable(observable, initialValue) {
53
46
  let t4;
54
47
  return $[7] !== initialValue ? (t4 = typeof initialValue > "u" ? void 0 : () => getValue(initialValue), $[7] = initialValue, $[8] = t4) : t4 = $[8], react.useSyncExternalStore(subscribe, t3, t4);
55
48
  }
49
+ function _temp4() {
50
+ return rxjs.timer(0, rxjs.asapScheduler);
51
+ }
52
+ function _temp3(value_0) {
53
+ }
54
+ function _temp2(error) {
55
+ return rxjs.of({
56
+ snapshot: void 0,
57
+ error
58
+ });
59
+ }
60
+ function _temp$1(value) {
61
+ return {
62
+ snapshot: value,
63
+ error: void 0
64
+ };
65
+ }
56
66
  function useObservableEvent(handleEvent) {
57
67
  const $ = reactCompilerRuntime.c(6), [t0] = react.useState(_temp), [calls$, call] = t0;
58
68
  let t1;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/useObservable.ts","../src/useObservableEvent.ts"],"sourcesContent":["import {useCallback, useMemo, useSyncExternalStore} from 'react'\nimport {\n asapScheduler,\n catchError,\n finalize,\n type Observable,\n type ObservedValueOf,\n of,\n share,\n timer,\n} from 'rxjs'\nimport {map, tap} from 'rxjs/operators'\n\nfunction getValue<T>(value: T): T extends () => infer U ? U : T {\n return typeof value === 'function' ? value() : value\n}\n\ninterface ObservableState<T> {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n}\n\ninterface CacheRecord<T> {\n observable: Observable<void>\n state: {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n }\n getSnapshot: (initialValue: unknown) => T\n}\n\nconst cache = new WeakMap<Observable<any>, CacheRecord<any>>()\n\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n initialValue: ObservedValueOf<ObservableType> | (() => ObservedValueOf<ObservableType>),\n): ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n): undefined | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue?: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType> {\n const instance = useMemo(() => {\n if (!cache.has(observable)) {\n // This separate object is used as a stable reference to the cache entry's snapshot and error.\n // It's used by the `getSnapshot` closure.\n const state: ObservableState<ObservedValueOf<ObservableType>> = {\n didEmit: false,\n }\n const entry: CacheRecord<ObservedValueOf<ObservableType>> = {\n state,\n observable: observable.pipe(\n map((value) => ({snapshot: value, error: undefined})),\n catchError((error) => of({snapshot: undefined, error})),\n tap(({snapshot, error}) => {\n state.didEmit = true\n state.snapshot = snapshot\n state.error = error\n }),\n // Note: any value or error emitted by the provided observable will be mapped to the cache entry's mutable state\n // and the observable is thereafter only used as a notifier to call `onStoreChange`, hence the `void` return type.\n map((value) => void value),\n // Ensure that the cache entry is deleted when the observable completes or errors.\n finalize(() => cache.delete(observable)),\n share({resetOnRefCountZero: () => timer(0, asapScheduler)}),\n ),\n getSnapshot: (initialValue) => {\n if (state.error) {\n throw state.error\n }\n return (\n state.didEmit ? state.snapshot : getValue(initialValue)\n ) as ObservedValueOf<ObservableType>\n },\n }\n\n // Eagerly subscribe to sync set `state.snapshot` to what the observable returns, and keep the observable alive until the component unmounts.\n const subscription = entry.observable.subscribe()\n subscription.unsubscribe()\n\n cache.set(observable, entry)\n }\n return cache.get(observable)!\n }, [observable])\n\n const subscribe = useCallback(\n (onStoreChange: () => void) => {\n const subscription = instance.observable.subscribe(onStoreChange)\n return () => {\n subscription.unsubscribe()\n }\n },\n [instance.observable],\n )\n\n return useSyncExternalStore<ObservedValueOf<ObservableType>>(\n subscribe,\n () => {\n return instance.getSnapshot(initialValue)\n },\n typeof initialValue === 'undefined'\n ? undefined\n : () => getValue(initialValue) as ObservedValueOf<ObservableType>,\n )\n}\n","import {observableCallback} from 'observable-callback'\nimport {useEffect, useState} from 'react'\nimport {type Observable} from 'rxjs'\nimport {useEffectEvent} from 'use-effect-event'\n\n/** @public */\nexport function useObservableEvent<T, U>(\n handleEvent: (arg: Observable<T>) => Observable<U>,\n): (arg: T) => void {\n const [[calls$, call]] = useState(() => observableCallback<T>())\n\n const onEvent = useEffectEvent((observable: Observable<T>) => handleEvent(observable))\n\n useEffect(() => {\n const subscription = calls$.pipe((observable) => onEvent(observable)).subscribe()\n return () => subscription.unsubscribe()\n }, [calls$, onEvent])\n\n return call\n}\n"],"names":["getValue","value","cache","WeakMap","useObservable","observable","initialValue","$","_c","t0","has","state","didEmit","entry","pipe","map","snapshot","error","undefined","catchError","of","tap","t1","error_0","value_0","finalize","delete","share","resetOnRefCountZero","timer","asapScheduler","getSnapshot","initialValue_0","subscribe","unsubscribe","set","get","instance","t2","onStoreChange","subscription_0","subscription","t3","t4","useSyncExternalStore","useObservableEvent","handleEvent","useState","_temp","calls$","call","onEvent","useEffectEvent","observable_0","useEffect","observableCallback"],"mappings":";;;AAaA,SAASA,SAAYC,OAA2C;AAC9D,SAAO,OAAOA,SAAU,aAAaA,MAAUA,IAAAA;AACjD;AAkBA,MAAMC,4BAAYC,QAA2C;AAiBtDC,SAAAA,cAAAC,YAAAC,cAAA;AAAAC,QAAAA,IAAAC,uBAAA,CAAA;AAAAC,MAAAA;AAAA,MAAA,CAKEP,MAAAQ,IAAUL,UAAU,GAAC;AAGxB,UAAAM,QAAA;AAAA,MAAAC,SAAA;AAAA,OAGAC,QAAA;AAAA,MAAAF;AAAAA,MAAAN,YAEcA,WAAUS,KACpBC,UAAAA,IAAAd,CAAA,WAAA;AAAA,QAAAe,UAA2Bf;AAAAA,QAAKgB,OAAAC;AAAAA,MAAoB,EAAA,GACpDC,KAAAA,WAAAF,CAAAA,UAAsBG,KAAAA,GAAA;AAAA,QAAAJ,UAAAE;AAAAA,QAAAD;AAAAA,MAAAA,CAA+B,CAAC,GACtDI,cAAAC,CAAAA,QAAA;AAAK,cAAA;AAAA,UAAAN;AAAAA,UAAAC,OAAAM;AAAAA,QAAAA,IAAAD;AACHX,cAAKC,UAAA,IACLD,MAAKK,WAAYA,UACjBL,MAAKM,QAASA;AAAAA,MAAAA,CACf,GAGDF,UAAAA,IAAAS,CAAA,YAAA;AAAA,MAAA,CAAyB,GAEzBC,cAAevB,MAAAA,MAAAwB,OAAarB,UAAU,CAAC,GACvCsB,WAAA;AAAA,QAAAC,qBAAAA,MAAkCC,cAAAC,KAAsB,aAAA;AAAA,MAAA,CAAE,CAC5D;AAAA,MAACC,aAAAC,CAAA,mBAAA;AAAA,YAEKrB,MAAKM;AAAA,gBACDN,MAAKM;AAAA,eAGXN,MAAKC,UAAWD,MAAKK,WAAYhB,SAASM,cAAY;AAAA,MAAA;AAAA,IAAC;AAMxCO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C,QAAAA,UAAgBC,8BAAe9B,EAAsD;AAAC,MAAAgB,IAAAI;AAAAnC,SAAAA,EAAA0C,CAAAA,MAAAA,UAAA1C,SAAA4C,WAE5Eb,KAAAA,MAAA;AACRG,UAAAA,eAAqBQ,OAAMnC,KAAAuC,CAAAA,iBAAsBF,QAAQ9C,YAAU,CAAC,EAAC4B,UAAW;AAAC,WAAA,MACpEQ,aAAYP,YAAa;AAAA,EACrCQ,GAAAA,KAAA,CAACO,QAAQE,OAAO,GAAC5C,OAAA0C,QAAA1C,OAAA4C,SAAA5C,OAAA+B,IAAA/B,OAAAmC,OAAAJ,KAAA/B,EAAA,CAAA,GAAAmC,KAAAnC,EAAA,CAAA,IAHpB+C,MAAAA,UAAUhB,IAGPI,EAAiB,GAEbQ;AAAI;AAZN,SAAAF,QAAA;AAAA,SAGmCO,sCAAsB;AAAC;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/useObservable.ts","../src/useObservableEvent.ts"],"sourcesContent":["import {useCallback, useMemo, useSyncExternalStore} from 'react'\nimport {\n asapScheduler,\n catchError,\n finalize,\n type Observable,\n type ObservedValueOf,\n of,\n share,\n timer,\n} from 'rxjs'\nimport {map, tap} from 'rxjs/operators'\n\nfunction getValue<T>(value: T): T extends () => infer U ? U : T {\n return typeof value === 'function' ? value() : value\n}\n\ninterface ObservableState<T> {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n}\n\ninterface CacheRecord<T> {\n observable: Observable<void>\n state: {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n }\n getSnapshot: (initialValue: unknown) => T\n}\n\nconst cache = new WeakMap<Observable<any>, CacheRecord<any>>()\n\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n initialValue: ObservedValueOf<ObservableType> | (() => ObservedValueOf<ObservableType>),\n): ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n): undefined | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue?: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType> {\n const instance = useMemo(() => {\n if (!cache.has(observable)) {\n // This separate object is used as a stable reference to the cache entry's snapshot and error.\n // It's used by the `getSnapshot` closure.\n const state: ObservableState<ObservedValueOf<ObservableType>> = {\n didEmit: false,\n }\n const entry: CacheRecord<ObservedValueOf<ObservableType>> = {\n state,\n observable: observable.pipe(\n map((value) => ({snapshot: value, error: undefined})),\n catchError((error) => of({snapshot: undefined, error})),\n tap(({snapshot, error}) => {\n state.didEmit = true\n state.snapshot = snapshot\n state.error = error\n }),\n // Note: any value or error emitted by the provided observable will be mapped to the cache entry's mutable state\n // and the observable is thereafter only used as a notifier to call `onStoreChange`, hence the `void` return type.\n map((value) => void value),\n // Ensure that the cache entry is deleted when the observable completes or errors.\n finalize(() => cache.delete(observable)),\n share({resetOnRefCountZero: () => timer(0, asapScheduler)}),\n ),\n getSnapshot: (initialValue) => {\n if (state.error) {\n throw state.error\n }\n return (\n state.didEmit ? state.snapshot : getValue(initialValue)\n ) as ObservedValueOf<ObservableType>\n },\n }\n\n // Eagerly subscribe to sync set `state.snapshot` to what the observable returns, and keep the observable alive until the component unmounts.\n const subscription = entry.observable.subscribe()\n subscription.unsubscribe()\n\n cache.set(observable, entry)\n }\n return cache.get(observable)!\n }, [observable])\n\n const subscribe = useCallback(\n (onStoreChange: () => void) => {\n const subscription = instance.observable.subscribe(onStoreChange)\n return () => {\n subscription.unsubscribe()\n }\n },\n [instance.observable],\n )\n\n return useSyncExternalStore<ObservedValueOf<ObservableType>>(\n subscribe,\n () => {\n return instance.getSnapshot(initialValue)\n },\n typeof initialValue === 'undefined'\n ? undefined\n : () => getValue(initialValue) as ObservedValueOf<ObservableType>,\n )\n}\n","import {observableCallback} from 'observable-callback'\nimport {useEffect, useState} from 'react'\nimport {type Observable} from 'rxjs'\nimport {useEffectEvent} from 'use-effect-event'\n\n/** @public */\nexport function useObservableEvent<T, U>(\n handleEvent: (arg: Observable<T>) => Observable<U>,\n): (arg: T) => void {\n const [[calls$, call]] = useState(() => observableCallback<T>())\n\n const onEvent = useEffectEvent((observable: Observable<T>) => handleEvent(observable))\n\n useEffect(() => {\n const subscription = calls$.pipe((observable) => onEvent(observable)).subscribe()\n return () => subscription.unsubscribe()\n }, [calls$, onEvent])\n\n return call\n}\n"],"names":["getValue","value","cache","WeakMap","useObservable","observable","initialValue","$","_c","t0","has","state","didEmit","entry","pipe","map","_temp","catchError","_temp2","tap","t1","snapshot","error","error_0","_temp3","finalize","delete","share","resetOnRefCountZero","_temp4","getSnapshot","initialValue_0","subscribe","unsubscribe","set","get","instance","t2","onStoreChange","subscription_0","subscription","t3","t4","undefined","useSyncExternalStore","timer","asapScheduler","value_0","of","useObservableEvent","handleEvent","useState","calls$","call","onEvent","useEffectEvent","observable_0","useEffect","observableCallback"],"mappings":";;;AAaA,SAASA,SAAYC,OAA2C;AAC9D,SAAO,OAAOA,SAAU,aAAaA,MAAUA,IAAAA;AACjD;AAkBA,MAAMC,4BAAYC,QAA2C;AAiBtDC,SAAAA,cAAAC,YAAAC,cAAA;AAAAC,QAAAA,IAAAC,uBAAA,CAAA;AAAAC,MAAAA;AAAA,MAAA,CAKEP,MAAAQ,IAAUL,UAAU,GAAC;AAGxB,UAAAM,QAAA;AAAA,MAAAC,SAAA;AAAA,OAGAC,QAAA;AAAA,MAAAF;AAAAA,MAAAN,YAEcA,WAAUS,KACpBC,UAAAA,IAAAC,OAAoD,GACpDC,KAAAA,WAAAC,MAAsD,GACtDC,cAAAC,CAAAA,QAAA;AAAK,cAAA;AAAA,UAAAC;AAAAA,UAAAC,OAAAC;AAAAA,QAAAA,IAAAH;AACHT,cAAKC,UAAA,IACLD,MAAKU,WA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B;AAAC;;;"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c } from "react-compiler-runtime";
2
2
  import { useSyncExternalStore, useState, useEffect } from "react";
3
- import { catchError, of, finalize, share, timer, asapScheduler } from "rxjs";
3
+ import { catchError, finalize, share, timer, asapScheduler, of } from "rxjs";
4
4
  import { map, tap } from "rxjs/operators";
5
5
  import { observableCallback } from "observable-callback";
6
6
  import { useEffectEvent } from "use-effect-event";
@@ -16,21 +16,14 @@ function useObservable(observable, initialValue) {
16
16
  didEmit: !1
17
17
  }, entry = {
18
18
  state,
19
- observable: observable.pipe(map((value) => ({
20
- snapshot: value,
21
- error: void 0
22
- })), catchError((error) => of({
23
- snapshot: void 0,
24
- error
25
- })), tap((t12) => {
19
+ observable: observable.pipe(map(_temp$1), catchError(_temp2), tap((t12) => {
26
20
  const {
27
21
  snapshot,
28
22
  error: error_0
29
23
  } = t12;
30
24
  state.didEmit = !0, state.snapshot = snapshot, state.error = error_0;
31
- }), map((value_0) => {
32
- }), finalize(() => cache.delete(observable)), share({
33
- resetOnRefCountZero: () => timer(0, asapScheduler)
25
+ }), map(_temp3), finalize(() => cache.delete(observable)), share({
26
+ resetOnRefCountZero: _temp4
34
27
  })),
35
28
  getSnapshot: (initialValue_0) => {
36
29
  if (state.error)
@@ -56,6 +49,23 @@ function useObservable(observable, initialValue) {
56
49
  let t4;
57
50
  return $[7] !== initialValue ? (t4 = typeof initialValue > "u" ? void 0 : () => getValue(initialValue), $[7] = initialValue, $[8] = t4) : t4 = $[8], useSyncExternalStore(subscribe, t3, t4);
58
51
  }
52
+ function _temp4() {
53
+ return timer(0, asapScheduler);
54
+ }
55
+ function _temp3(value_0) {
56
+ }
57
+ function _temp2(error) {
58
+ return of({
59
+ snapshot: void 0,
60
+ error
61
+ });
62
+ }
63
+ function _temp$1(value) {
64
+ return {
65
+ snapshot: value,
66
+ error: void 0
67
+ };
68
+ }
59
69
  function useObservableEvent(handleEvent) {
60
70
  const $ = c(6), [t0] = useState(_temp), [calls$, call] = t0;
61
71
  let t1;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/useObservable.ts","../src/useObservableEvent.ts"],"sourcesContent":["import {useCallback, useMemo, useSyncExternalStore} from 'react'\nimport {\n asapScheduler,\n catchError,\n finalize,\n type Observable,\n type ObservedValueOf,\n of,\n share,\n timer,\n} from 'rxjs'\nimport {map, tap} from 'rxjs/operators'\n\nfunction getValue<T>(value: T): T extends () => infer U ? U : T {\n return typeof value === 'function' ? value() : value\n}\n\ninterface ObservableState<T> {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n}\n\ninterface CacheRecord<T> {\n observable: Observable<void>\n state: {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n }\n getSnapshot: (initialValue: unknown) => T\n}\n\nconst cache = new WeakMap<Observable<any>, CacheRecord<any>>()\n\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n initialValue: ObservedValueOf<ObservableType> | (() => ObservedValueOf<ObservableType>),\n): ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n): undefined | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue?: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType> {\n const instance = useMemo(() => {\n if (!cache.has(observable)) {\n // This separate object is used as a stable reference to the cache entry's snapshot and error.\n // It's used by the `getSnapshot` closure.\n const state: ObservableState<ObservedValueOf<ObservableType>> = {\n didEmit: false,\n }\n const entry: CacheRecord<ObservedValueOf<ObservableType>> = {\n state,\n observable: observable.pipe(\n map((value) => ({snapshot: value, error: undefined})),\n catchError((error) => of({snapshot: undefined, error})),\n tap(({snapshot, error}) => {\n state.didEmit = true\n state.snapshot = snapshot\n state.error = error\n }),\n // Note: any value or error emitted by the provided observable will be mapped to the cache entry's mutable state\n // and the observable is thereafter only used as a notifier to call `onStoreChange`, hence the `void` return type.\n map((value) => void value),\n // Ensure that the cache entry is deleted when the observable completes or errors.\n finalize(() => cache.delete(observable)),\n share({resetOnRefCountZero: () => timer(0, asapScheduler)}),\n ),\n getSnapshot: (initialValue) => {\n if (state.error) {\n throw state.error\n }\n return (\n state.didEmit ? state.snapshot : getValue(initialValue)\n ) as ObservedValueOf<ObservableType>\n },\n }\n\n // Eagerly subscribe to sync set `state.snapshot` to what the observable returns, and keep the observable alive until the component unmounts.\n const subscription = entry.observable.subscribe()\n subscription.unsubscribe()\n\n cache.set(observable, entry)\n }\n return cache.get(observable)!\n }, [observable])\n\n const subscribe = useCallback(\n (onStoreChange: () => void) => {\n const subscription = instance.observable.subscribe(onStoreChange)\n return () => {\n subscription.unsubscribe()\n }\n },\n [instance.observable],\n )\n\n return useSyncExternalStore<ObservedValueOf<ObservableType>>(\n subscribe,\n () => {\n return instance.getSnapshot(initialValue)\n },\n typeof initialValue === 'undefined'\n ? undefined\n : () => getValue(initialValue) as ObservedValueOf<ObservableType>,\n )\n}\n","import {observableCallback} from 'observable-callback'\nimport {useEffect, useState} from 'react'\nimport {type Observable} from 'rxjs'\nimport {useEffectEvent} from 'use-effect-event'\n\n/** @public */\nexport function useObservableEvent<T, U>(\n handleEvent: (arg: Observable<T>) => Observable<U>,\n): (arg: T) => void {\n const [[calls$, call]] = useState(() => observableCallback<T>())\n\n const onEvent = useEffectEvent((observable: Observable<T>) => handleEvent(observable))\n\n useEffect(() => {\n const subscription = calls$.pipe((observable) => onEvent(observable)).subscribe()\n return () => subscription.unsubscribe()\n }, [calls$, onEvent])\n\n return call\n}\n"],"names":["getValue","value","cache","WeakMap","useObservable","observable","initialValue","$","_c","t0","has","state","didEmit","entry","pipe","map","snapshot","error","undefined","catchError","of","tap","t1","error_0","value_0","finalize","delete","share","resetOnRefCountZero","timer","asapScheduler","getSnapshot","initialValue_0","subscribe","unsubscribe","set","get","instance","t2","onStoreChange","subscription_0","subscription","t3","t4","useSyncExternalStore","useObservableEvent","handleEvent","useState","_temp","calls$","call","onEvent","useEffectEvent","observable_0","useEffect","observableCallback"],"mappings":";;;;;;AAaA,SAASA,SAAYC,OAA2C;AAC9D,SAAO,OAAOA,SAAU,aAAaA,MAAUA,IAAAA;AACjD;AAkBA,MAAMC,4BAAYC,QAA2C;AAiBtDC,SAAAA,cAAAC,YAAAC,cAAA;AAAAC,QAAAA,IAAAC,EAAA,CAAA;AAAAC,MAAAA;AAAA,MAAA,CAKEP,MAAAQ,IAAUL,UAAU,GAAC;AAGxB,UAAAM,QAAA;AAAA,MAAAC,SAAA;AAAA,OAGAC,QAAA;AAAA,MAAAF;AAAAA,MAAAN,YAEcA,WAAUS,KACpBC,IAAAd,CAAA,WAAA;AAAA,QAAAe,UAA2Bf;AAAAA,QAAKgB,OAAAC;AAAAA,MAAoB,EAAA,GACpDC,WAAAF,CAAAA,UAAsBG,GAAA;AAAA,QAAAJ,UAAAE;AAAAA,QAAAD;AAAAA,MAAAA,CAA+B,CAAC,GACtDI,IAAAC,CAAAA,QAAA;AAAK,cAAA;AAAA,UAAAN;AAAAA,UAAAC,OAAAM;AAAAA,QAAAA,IAAAD;AACHX,cAAKC,UAAA,IACLD,MAAKK,WAAYA,UACjBL,MAAKM,QAASA;AAAAA,MAAAA,CACf,GAGDF,IAAAS,CAAA,YAAA;AAAA,MAAA,CAAyB,GAEzBC,SAAevB,MAAAA,MAAAwB,OAAarB,UAAU,CAAC,GACvCsB,MAAA;AAAA,QAAAC,qBAAAA,MAAkCC,SAAAC,aAAsB;AAAA,MAAA,CAAE,CAC5D;AAAA,MAACC,aAAAC,CAAA,mBAAA;AAAA,YAEKrB,MAAKM;AAAA,gBACDN,MAAKM;AAAA,eAGXN,MAAKC,UAAWD,MAAKK,WAAYhB,SAASM,cAAY;A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;AAArF4C,QAAAA,UAAgBC,eAAe9B,EAAsD;AAAC,MAAAgB,IAAAI;AAAAnC,SAAAA,EAAA0C,CAAAA,MAAAA,UAAA1C,SAAA4C,WAE5Eb,KAAAA,MAAA;AACRG,UAAAA,eAAqBQ,OAAMnC,KAAAuC,CAAAA,iBAAsBF,QAAQ9C,YAAU,CAAC,EAAC4B,UAAW;AAAC,WAAA,MACpEQ,aAAYP,YAAa;AAAA,EACrCQ,GAAAA,KAAA,CAACO,QAAQE,OAAO,GAAC5C,OAAA0C,QAAA1C,OAAA4C,SAAA5C,OAAA+B,IAAA/B,OAAAmC,OAAAJ,KAAA/B,EAAA,CAAA,GAAAmC,KAAAnC,EAAA,CAAA,IAHpB+C,UAAUhB,IAGPI,EAAiB,GAEbQ;AAAI;AAZN,SAAAF,QAAA;AAAA,SAGmCO,mBAAsB;AAAC;"}
1
+ {"version":3,"file":"index.js","sources":["../src/useObservable.ts","../src/useObservableEvent.ts"],"sourcesContent":["import {useCallback, useMemo, useSyncExternalStore} from 'react'\nimport {\n asapScheduler,\n catchError,\n finalize,\n type Observable,\n type ObservedValueOf,\n of,\n share,\n timer,\n} from 'rxjs'\nimport {map, tap} from 'rxjs/operators'\n\nfunction getValue<T>(value: T): T extends () => infer U ? U : T {\n return typeof value === 'function' ? value() : value\n}\n\ninterface ObservableState<T> {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n}\n\ninterface CacheRecord<T> {\n observable: Observable<void>\n state: {\n didEmit: boolean\n snapshot?: T\n error?: unknown\n }\n getSnapshot: (initialValue: unknown) => T\n}\n\nconst cache = new WeakMap<Observable<any>, CacheRecord<any>>()\n\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n initialValue: ObservedValueOf<ObservableType> | (() => ObservedValueOf<ObservableType>),\n): ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>>(\n observable: ObservableType,\n): undefined | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType>\n/** @public */\nexport function useObservable<ObservableType extends Observable<any>, InitialValue>(\n observable: ObservableType,\n initialValue?: InitialValue | (() => InitialValue),\n): InitialValue | ObservedValueOf<ObservableType> {\n const instance = useMemo(() => {\n if (!cache.has(observable)) {\n // This separate object is used as a stable reference to the cache entry's snapshot and error.\n // It's used by the `getSnapshot` closure.\n const state: ObservableState<ObservedValueOf<ObservableType>> = {\n didEmit: false,\n }\n const entry: CacheRecord<ObservedValueOf<ObservableType>> = {\n state,\n observable: observable.pipe(\n map((value) => ({snapshot: value, error: undefined})),\n catchError((error) => of({snapshot: undefined, error})),\n tap(({snapshot, error}) => {\n state.didEmit = true\n state.snapshot = snapshot\n state.error = error\n }),\n // Note: any value or error emitted by the provided observable will be mapped to the cache entry's mutable state\n // and the observable is thereafter only used as a notifier to call `onStoreChange`, hence the `void` return type.\n map((value) => void value),\n // Ensure that the cache entry is deleted when the observable completes or errors.\n finalize(() => cache.delete(observable)),\n share({resetOnRefCountZero: () => timer(0, asapScheduler)}),\n ),\n getSnapshot: (initialValue) => {\n if (state.error) {\n throw state.error\n }\n return (\n state.didEmit ? state.snapshot : getValue(initialValue)\n ) as ObservedValueOf<ObservableType>\n },\n }\n\n // Eagerly subscribe to sync set `state.snapshot` to what the observable returns, and keep the observable alive until the component unmounts.\n const subscription = entry.observable.subscribe()\n subscription.unsubscribe()\n\n cache.set(observable, entry)\n }\n return cache.get(observable)!\n }, [observable])\n\n const subscribe = useCallback(\n (onStoreChange: () => void) => {\n const subscription = instance.observable.subscribe(onStoreChange)\n return () => {\n subscription.unsubscribe()\n }\n },\n [instance.observable],\n )\n\n return useSyncExternalStore<ObservedValueOf<ObservableType>>(\n subscribe,\n () => {\n return instance.getSnapshot(initialValue)\n },\n typeof initialValue === 'undefined'\n ? undefined\n : () => getValue(initialValue) as ObservedValueOf<ObservableType>,\n )\n}\n","import {observableCallback} from 'observable-callback'\nimport {useEffect, useState} from 'react'\nimport {type Observable} from 'rxjs'\nimport {useEffectEvent} from 'use-effect-event'\n\n/** @public */\nexport function useObservableEvent<T, U>(\n handleEvent: (arg: Observable<T>) => Observable<U>,\n): (arg: T) => void {\n const [[calls$, call]] = useState(() => observableCallback<T>())\n\n const onEvent = useEffectEvent((observable: Observable<T>) => handleEvent(observable))\n\n useEffect(() => {\n const subscription = calls$.pipe((observable) => onEvent(observable)).subscribe()\n return () => subscription.unsubscribe()\n }, [calls$, onEvent])\n\n return call\n}\n"],"names":["getValue","value","cache","WeakMap","useObservable","observable","initialValue","$","_c","t0","has","state","didEmit","entry","pipe","map","_temp","catchError","_temp2","tap","t1","snapshot","error","error_0","_temp3","finalize","delete","share","resetOnRefCountZero","_temp4","getSnapshot","initialValue_0","subscribe","unsubscribe","set","get","instance","t2","onStoreChange","subscription_0","subscription","t3","t4","undefined","useSyncExternalStore","timer","asapScheduler","value_0","of","useObservableEvent","handleEvent","useState","calls$","call","onEvent","useEffectEvent","observable_0","useEffect","observableCallback"],"mappings":";;;;;;AAaA,SAASA,SAAYC,OAA2C;AAC9D,SAAO,OAAOA,SAAU,aAAaA,MAAUA,IAAAA;AACjD;AAkBA,MAAMC,4BAAYC,QAA2C;AAiBtDC,SAAAA,cAAAC,YAAAC,cAAA;AAAAC,QAAAA,IAAAC,EAAA,CAAA;AAAAC,MAAAA;AAAA,MAAA,CAKEP,MAAAQ,IAAUL,UAAU,GAAC;AAGxB,UAAAM,QAAA;AAAA,MAAAC,SAAA;AAAA,OAGAC,QAAA;AAAA,MAAAF;AAAAA,MAAAN,YAEcA,WAAUS,KACpBC,IAAAC,OAAoD,GACpDC,WAAAC,MAAsD,GACtDC,IAAAC,CAAAA,QAAA;AAAK,cAAA;AAAA,UAAAC;AAAAA,UAAAC,OAAAC;AAAAA,QAAAA,IAAAH;AACHT,cAAKC,UAAA,IACLD,MAAKU,WAAYA,UACjBV,MAAKW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
- "version": "4.1.5",
3
+ "version": "4.1.6",
4
4
  "description": "React + RxJS = <3",
5
5
  "keywords": [
6
6
  "action",
@@ -75,11 +75,11 @@
75
75
  "prettier": "@sanity/prettier-config",
76
76
  "dependencies": {
77
77
  "observable-callback": "^1.0.3",
78
- "react-compiler-runtime": "19.0.0-beta-a7bf2bd-20241110",
78
+ "react-compiler-runtime": "19.0.0-beta-0dec889-20241115",
79
79
  "use-effect-event": "^1.0.2"
80
80
  },
81
81
  "devDependencies": {
82
- "@sanity/pkg-utils": "^6.11.9",
82
+ "@sanity/pkg-utils": "^6.11.10",
83
83
  "@sanity/prettier-config": "^1.0.3",
84
84
  "@sanity/semantic-release-preset": "^5.0.0",
85
85
  "@testing-library/dom": "^10.4.0",
@@ -90,12 +90,12 @@
90
90
  "@typescript-eslint/eslint-plugin": "^8.13.0",
91
91
  "@typescript-eslint/parser": "^8.13.0",
92
92
  "@vitejs/plugin-react": "^4.3.3",
93
- "babel-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
93
+ "babel-plugin-react-compiler": "19.0.0-beta-0dec889-20241115",
94
94
  "eslint": "^8.57.1",
95
95
  "eslint-config-prettier": "^9.1.0",
96
96
  "eslint-plugin-prettier": "^5.2.1",
97
97
  "eslint-plugin-react": "^7.37.2",
98
- "eslint-plugin-react-compiler": "19.0.0-beta-a7bf2bd-20241110",
98
+ "eslint-plugin-react-compiler": "19.0.0-beta-0dec889-20241115",
99
99
  "eslint-plugin-react-hooks": "^5.0.0",
100
100
  "eslint-plugin-simple-import-sort": "^12.1.1",
101
101
  "jsdom": "^24.1.0",