@tstdl/base 0.91.8 → 0.91.10

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,5 +1,5 @@
1
1
  import { BehaviorSubject, Subject, distinctUntilChanged, filter, firstValueFrom, map, startWith } from 'rxjs';
2
- import { getCurrentSignalsInjector, toLazySignal, untracked } from '../signals/index.js';
2
+ import { toLazySignal, untracked } from '../signals/index.js';
3
3
  import { lazyProperty } from '../utils/object/lazy-property.js';
4
4
  export class Collection {
5
5
  sizeSubject = new BehaviorSubject(0);
@@ -50,11 +50,10 @@ export class Collection {
50
50
  return this.size > 0;
51
51
  }
52
52
  constructor() {
53
- const injector = getCurrentSignalsInjector();
54
- lazyProperty(this, '$size', () => untracked(() => toLazySignal(this.size$, { injector, requireSync: true })));
55
- lazyProperty(this, '$observe', () => untracked(() => toLazySignal(this.observe$, { injector, requireSync: true, equal: () => false })));
56
- lazyProperty(this, '$isEmpty', () => untracked(() => toLazySignal(this.isEmpty$, { injector, requireSync: true })));
57
- lazyProperty(this, '$hasItems', () => untracked(() => toLazySignal(this.hasItems$, { injector, requireSync: true })));
53
+ lazyProperty(this, '$size', () => untracked(() => toLazySignal(this.size$, { requireSync: true })));
54
+ lazyProperty(this, '$observe', () => untracked(() => toLazySignal(this.observe$, { requireSync: true, equal: () => false })));
55
+ lazyProperty(this, '$isEmpty', () => untracked(() => toLazySignal(this.isEmpty$, { requireSync: true })));
56
+ lazyProperty(this, '$hasItems', () => untracked(() => toLazySignal(this.hasItems$, { requireSync: true })));
58
57
  }
59
58
  [Symbol.iterator]() {
60
59
  return this.items();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.91.8",
3
+ "version": "0.91.10",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/signals/api.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Tagged } from 'type-fest';
2
2
  import type * as Types from './implementation/index.js';
3
- export type { CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, EffectCleanupRegisterFn, EffectRef, Signal, ToSignalOptions, WritableSignal } from './implementation/index.js';
3
+ export type { CreateComputedOptions, CreateEffectOptions, CreateSignalOptions, EffectCleanupRegisterFn, EffectRef, Signal, ToObservableOptions, ToSignalOptions, WritableSignal } from './implementation/index.js';
4
4
  export type SignalsInjector = Tagged<symbol, 'injector'>;
5
5
  export type SignalsConfiguration<TInjector = SignalsInjector> = {
6
6
  signal: typeof Types.signal;
@@ -16,7 +16,7 @@ export function toObservable(source, options) {
16
16
  catch (error) {
17
17
  untracked(() => subscriber.error(error));
18
18
  }
19
- }, { allowSignalWrites: true, injector: options?.injector });
19
+ }, { allowSignalWrites: true, injector: options?.injector, manualCleanup: true });
20
20
  return () => effectRef.destroy();
21
21
  });
22
22
  }