@valentin30/signal 0.0.8 → 0.0.9

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.d.mts CHANGED
@@ -1,13 +1,13 @@
1
- type Function = (...args: any[]) => any;
1
+ type Callable = (...args: any[]) => any;
2
2
 
3
3
  type Maybe<T> = T | null | undefined;
4
4
 
5
- type Factory<Fn extends Function> = Fn & {
5
+ type Factory<Fn extends Callable> = Fn & {
6
6
  factory(factory: Maybe<Fn>): void;
7
7
  default(factory: Maybe<Fn>): void;
8
8
  configured(): boolean;
9
9
  };
10
- declare function factory<Fn extends Function>(name: string): Factory<Fn>;
10
+ declare function factory<Fn extends Callable>(name: string): Factory<Fn>;
11
11
 
12
12
  type Callback = () => void;
13
13
 
@@ -198,4 +198,4 @@ interface Config {
198
198
  }
199
199
  declare function config(config?: Config): void;
200
200
 
201
- export { type Batch, type Callback, type Collector$1 as Collector, type CollectorFactory, type Comparable, type ComposedFactory, type ComputedFactory, type Config, type Effect, type EffectCallback, type EffectCleanup, type Equals, type Factory, type Function, type Ignore, type Maybe, type Peekable, type Readable, type ReadonlySignal, type Signal$1 as Signal, type SignalFactory, type Subscribable, type Writable, batch, collector$1 as collector, composed, computed, config, effect$1 as effect, factory, ignore, index as internal, signal$1 as signal };
201
+ export { type Batch, type Callable, type Callback, type Collector$1 as Collector, type CollectorFactory, type Comparable, type ComposedFactory, type ComputedFactory, type Config, type Effect, type EffectCallback, type EffectCleanup, type Equals, type Factory, type Ignore, type Maybe, type Peekable, type Readable, type ReadonlySignal, type Signal$1 as Signal, type SignalFactory, type Subscribable, type Writable, batch, collector$1 as collector, composed, computed, config, effect$1 as effect, factory, ignore, index as internal, signal$1 as signal };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- type Function = (...args: any[]) => any;
1
+ type Callable = (...args: any[]) => any;
2
2
 
3
3
  type Maybe<T> = T | null | undefined;
4
4
 
5
- type Factory<Fn extends Function> = Fn & {
5
+ type Factory<Fn extends Callable> = Fn & {
6
6
  factory(factory: Maybe<Fn>): void;
7
7
  default(factory: Maybe<Fn>): void;
8
8
  configured(): boolean;
9
9
  };
10
- declare function factory<Fn extends Function>(name: string): Factory<Fn>;
10
+ declare function factory<Fn extends Callable>(name: string): Factory<Fn>;
11
11
 
12
12
  type Callback = () => void;
13
13
 
@@ -198,4 +198,4 @@ interface Config {
198
198
  }
199
199
  declare function config(config?: Config): void;
200
200
 
201
- export { type Batch, type Callback, type Collector$1 as Collector, type CollectorFactory, type Comparable, type ComposedFactory, type ComputedFactory, type Config, type Effect, type EffectCallback, type EffectCleanup, type Equals, type Factory, type Function, type Ignore, type Maybe, type Peekable, type Readable, type ReadonlySignal, type Signal$1 as Signal, type SignalFactory, type Subscribable, type Writable, batch, collector$1 as collector, composed, computed, config, effect$1 as effect, factory, ignore, index as internal, signal$1 as signal };
201
+ export { type Batch, type Callable, type Callback, type Collector$1 as Collector, type CollectorFactory, type Comparable, type ComposedFactory, type ComputedFactory, type Config, type Effect, type EffectCallback, type EffectCleanup, type Equals, type Factory, type Ignore, type Maybe, type Peekable, type Readable, type ReadonlySignal, type Signal$1 as Signal, type SignalFactory, type Subscribable, type Writable, batch, collector$1 as collector, composed, computed, config, effect$1 as effect, factory, ignore, index as internal, signal$1 as signal };
package/dist/index.js CHANGED
@@ -42,9 +42,13 @@ function factory(name) {
42
42
  if (__default__) return __default__(...args);
43
43
  throw new Error(`${name}.factory() not configured!`);
44
44
  }
45
- object.default = (factory2) => __default__ = factory2;
46
- object.factory = (factory2) => __factory__ = factory2;
47
45
  object.configured = () => __default__ !== null || __factory__ !== null;
46
+ object.default = (factory2) => {
47
+ __default__ = factory2 ?? null;
48
+ };
49
+ object.factory = (factory2) => {
50
+ __factory__ = factory2 ?? null;
51
+ };
48
52
  return object;
49
53
  }
50
54
 
package/dist/index.mjs CHANGED
@@ -13,9 +13,13 @@ function factory(name) {
13
13
  if (__default__) return __default__(...args);
14
14
  throw new Error(`${name}.factory() not configured!`);
15
15
  }
16
- object.default = (factory2) => __default__ = factory2;
17
- object.factory = (factory2) => __factory__ = factory2;
18
16
  object.configured = () => __default__ !== null || __factory__ !== null;
17
+ object.default = (factory2) => {
18
+ __default__ = factory2 ?? null;
19
+ };
20
+ object.factory = (factory2) => {
21
+ __factory__ = factory2 ?? null;
22
+ };
19
23
  return object;
20
24
  }
21
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valentin30/signal",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "My take on signals - lightweight reactive primitives inspired by Preact Signals, written in TypeScript.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",