@talismn/util 0.0.0-pr2075-20250710131942 → 0.0.0-pr2076-20250703120215

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.
@@ -30,4 +30,3 @@ export * from "./isNotNil";
30
30
  export * from "./isTruthy";
31
31
  export * from "./isAbortError";
32
32
  export * from "./getSharedObservable";
33
- export * from "./keepAlive";
@@ -345,40 +345,6 @@ const getSharedObservable = (namespace, args, createObservable, serializer = arg
345
345
  return sharedObs;
346
346
  };
347
347
 
348
- /**
349
- * An RxJS operator that keeps the source observable alive for a specified duration
350
- * after all subscribers have unsubscribed. This prevents expensive re-subscriptions
351
- * when subscribers come and go frequently.
352
- *
353
- * @param keepAliveMs - Duration in milliseconds to keep the source alive after last unsubscription
354
- * @returns MonoTypeOperatorFunction that can be used in pipe()
355
- *
356
- * @example
357
- * ```typescript
358
- * const data$ = expensive_api_call$.pipe(
359
- * keepAlive(3000) // Keep alive for 3 seconds
360
- * );
361
- * ```
362
- */
363
- const keepAlive = timeout => {
364
- let release;
365
- return source => source.pipe(rxjs.tap({
366
- subscribe: () => {
367
- release = keepSourceSubscribed(source, timeout);
368
- },
369
- unsubscribe: () => {
370
- release?.();
371
- }
372
- }), rxjs.shareReplay({
373
- refCount: true,
374
- bufferSize: 1
375
- }));
376
- };
377
- const keepSourceSubscribed = (observable, ms) => {
378
- const sub = observable.subscribe();
379
- return () => setTimeout(() => sub.unsubscribe(), ms);
380
- };
381
-
382
348
  exports.BigMath = BigMath;
383
349
  exports.Deferred = Deferred;
384
350
  exports.MAX_DECIMALS_FORMAT = MAX_DECIMALS_FORMAT;
@@ -404,7 +370,6 @@ exports.isEthereumAddress = isEthereumAddress;
404
370
  exports.isNotNil = isNotNil;
405
371
  exports.isTruthy = isTruthy;
406
372
  exports.isValidSubstrateAddress = isValidSubstrateAddress;
407
- exports.keepAlive = keepAlive;
408
373
  exports.normalizeAddress = normalizeAddress;
409
374
  exports.planckToTokens = planckToTokens;
410
375
  exports.sleep = sleep;
@@ -345,40 +345,6 @@ const getSharedObservable = (namespace, args, createObservable, serializer = arg
345
345
  return sharedObs;
346
346
  };
347
347
 
348
- /**
349
- * An RxJS operator that keeps the source observable alive for a specified duration
350
- * after all subscribers have unsubscribed. This prevents expensive re-subscriptions
351
- * when subscribers come and go frequently.
352
- *
353
- * @param keepAliveMs - Duration in milliseconds to keep the source alive after last unsubscription
354
- * @returns MonoTypeOperatorFunction that can be used in pipe()
355
- *
356
- * @example
357
- * ```typescript
358
- * const data$ = expensive_api_call$.pipe(
359
- * keepAlive(3000) // Keep alive for 3 seconds
360
- * );
361
- * ```
362
- */
363
- const keepAlive = timeout => {
364
- let release;
365
- return source => source.pipe(rxjs.tap({
366
- subscribe: () => {
367
- release = keepSourceSubscribed(source, timeout);
368
- },
369
- unsubscribe: () => {
370
- release?.();
371
- }
372
- }), rxjs.shareReplay({
373
- refCount: true,
374
- bufferSize: 1
375
- }));
376
- };
377
- const keepSourceSubscribed = (observable, ms) => {
378
- const sub = observable.subscribe();
379
- return () => setTimeout(() => sub.unsubscribe(), ms);
380
- };
381
-
382
348
  exports.BigMath = BigMath;
383
349
  exports.Deferred = Deferred;
384
350
  exports.MAX_DECIMALS_FORMAT = MAX_DECIMALS_FORMAT;
@@ -404,7 +370,6 @@ exports.isEthereumAddress = isEthereumAddress;
404
370
  exports.isNotNil = isNotNil;
405
371
  exports.isTruthy = isTruthy;
406
372
  exports.isValidSubstrateAddress = isValidSubstrateAddress;
407
- exports.keepAlive = keepAlive;
408
373
  exports.normalizeAddress = normalizeAddress;
409
374
  exports.planckToTokens = planckToTokens;
410
375
  exports.sleep = sleep;
@@ -2,7 +2,7 @@ import { u8aToHex, u8aConcat, u8aToU8a, hexToU8a } from '@polkadot/util';
2
2
  import { blake2AsU8a, isEthereumAddress as isEthereumAddress$1, ethereumEncode, decodeAddress as decodeAddress$1, base58Decode, checkAddressChecksum, xxhashAsU8a } from '@polkadot/util-crypto';
3
3
  import { twMerge } from 'tailwind-merge';
4
4
  import { encodeAddress, decodeAddress } from '@polkadot/keyring';
5
- import { concat, take, skip, debounceTime, shareReplay, tap } from 'rxjs';
5
+ import { concat, take, skip, debounceTime, shareReplay } from 'rxjs';
6
6
  import BigNumber from 'bignumber.js';
7
7
 
8
8
  const addTrailingSlash = url => {
@@ -339,38 +339,4 @@ const getSharedObservable = (namespace, args, createObservable, serializer = arg
339
339
  return sharedObs;
340
340
  };
341
341
 
342
- /**
343
- * An RxJS operator that keeps the source observable alive for a specified duration
344
- * after all subscribers have unsubscribed. This prevents expensive re-subscriptions
345
- * when subscribers come and go frequently.
346
- *
347
- * @param keepAliveMs - Duration in milliseconds to keep the source alive after last unsubscription
348
- * @returns MonoTypeOperatorFunction that can be used in pipe()
349
- *
350
- * @example
351
- * ```typescript
352
- * const data$ = expensive_api_call$.pipe(
353
- * keepAlive(3000) // Keep alive for 3 seconds
354
- * );
355
- * ```
356
- */
357
- const keepAlive = timeout => {
358
- let release;
359
- return source => source.pipe(tap({
360
- subscribe: () => {
361
- release = keepSourceSubscribed(source, timeout);
362
- },
363
- unsubscribe: () => {
364
- release?.();
365
- }
366
- }), shareReplay({
367
- refCount: true,
368
- bufferSize: 1
369
- }));
370
- };
371
- const keepSourceSubscribed = (observable, ms) => {
372
- const sub = observable.subscribe();
373
- return () => setTimeout(() => sub.unsubscribe(), ms);
374
- };
375
-
376
- export { BigMath, Deferred, MAX_DECIMALS_FORMAT, addTrailingSlash, blake2Concat, classNames, convertAddress, decodeAnyAddress, decodeSs58Format, encodeAnyAddress, firstThenDebounce, formatDecimals, formatPrice, getSharedObservable, hasOwnProperty, isAbortError, isAddressEqual, isArrayOf, isAscii, isBigInt, isBooleanTrue, isEthereumAddress, isNotNil, isTruthy, isValidSubstrateAddress, keepAlive, normalizeAddress, planckToTokens, sleep, throwAfter, tokensToPlanck, twox64Concat, validateHexString };
342
+ export { BigMath, Deferred, MAX_DECIMALS_FORMAT, addTrailingSlash, blake2Concat, classNames, convertAddress, decodeAnyAddress, decodeSs58Format, encodeAnyAddress, firstThenDebounce, formatDecimals, formatPrice, getSharedObservable, hasOwnProperty, isAbortError, isAddressEqual, isArrayOf, isAscii, isBigInt, isBooleanTrue, isEthereumAddress, isNotNil, isTruthy, isValidSubstrateAddress, normalizeAddress, planckToTokens, sleep, throwAfter, tokensToPlanck, twox64Concat, validateHexString };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@talismn/util",
3
- "version": "0.0.0-pr2075-20250710131942",
3
+ "version": "0.0.0-pr2076-20250703120215",
4
4
  "author": "Talisman",
5
5
  "homepage": "https://talisman.xyz",
6
6
  "license": "GPL-3.0-or-later",
@@ -1,17 +0,0 @@
1
- import type { OperatorFunction } from "rxjs";
2
- /**
3
- * An RxJS operator that keeps the source observable alive for a specified duration
4
- * after all subscribers have unsubscribed. This prevents expensive re-subscriptions
5
- * when subscribers come and go frequently.
6
- *
7
- * @param keepAliveMs - Duration in milliseconds to keep the source alive after last unsubscription
8
- * @returns MonoTypeOperatorFunction that can be used in pipe()
9
- *
10
- * @example
11
- * ```typescript
12
- * const data$ = expensive_api_call$.pipe(
13
- * keepAlive(3000) // Keep alive for 3 seconds
14
- * );
15
- * ```
16
- */
17
- export declare const keepAlive: <T>(timeout: number) => OperatorFunction<T, T>;