@esportsplus/reactivity 0.3.2 → 0.3.3
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/build/index.d.ts +6 -6
- package/build/index.js +6 -6
- package/build/macro.d.ts +1 -1
- package/build/macro.js +1 -1
- package/build/reactive/array.d.ts +14 -14
- package/build/reactive/array.js +2 -2
- package/build/reactive/index.d.ts +1 -1
- package/build/reactive/index.js +2 -2
- package/build/reactive/object.d.ts +1 -1
- package/build/reactive/object.js +2 -2
- package/build/resource.d.ts +1 -1
- package/build/resource.js +1 -1
- package/build/signal.d.ts +1 -1
- package/build/signal.js +1 -1
- package/build/types.d.ts +4 -4
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as macro } from './macro';
|
|
2
|
-
export { default as resource } from './resource';
|
|
3
|
-
export { default as reactive } from './reactive';
|
|
4
|
-
export { computed, dispose, effect, root, signal } from './signal';
|
|
5
|
-
export * from './constants';
|
|
6
|
-
export * from './types';
|
|
1
|
+
export { default as macro } from './macro.js';
|
|
2
|
+
export { default as resource } from './resource.js';
|
|
3
|
+
export { default as reactive } from './reactive/index.js';
|
|
4
|
+
export { computed, dispose, effect, root, signal } from './signal.js';
|
|
5
|
+
export * from './constants.js';
|
|
6
|
+
export * from './types.js';
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as macro } from './macro';
|
|
2
|
-
export { default as resource } from './resource';
|
|
3
|
-
export { default as reactive } from './reactive';
|
|
4
|
-
export { computed, dispose, effect, root, signal } from './signal';
|
|
5
|
-
export * from './constants';
|
|
6
|
-
export * from './types';
|
|
1
|
+
export { default as macro } from './macro.js';
|
|
2
|
+
export { default as resource } from './resource.js';
|
|
3
|
+
export { default as reactive } from './reactive/index.js';
|
|
4
|
+
export { computed, dispose, effect, root, signal } from './signal.js';
|
|
5
|
+
export * from './constants.js';
|
|
6
|
+
export * from './types.js';
|
package/build/macro.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import CustomFunction from '@esportsplus/custom-function';
|
|
2
|
-
import { Options } from './types';
|
|
2
|
+
import { Options } from './types.js';
|
|
3
3
|
declare class Macro<A extends unknown[], R> extends CustomFunction {
|
|
4
4
|
private factory;
|
|
5
5
|
constructor(fn: Macro<A, R>['factory']['fn'], options?: Options);
|
package/build/macro.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Infer, Prettify } from '../types';
|
|
2
|
-
import { Listener, Options, ReactiveObject, Signal } from '../types';
|
|
1
|
+
import { Infer, Prettify } from '../types.js';
|
|
2
|
+
import { Listener, Options, ReactiveObject, Signal } from '../types.js';
|
|
3
3
|
type API<T> = Prettify<Infer<T>[] & ReturnType<typeof methods<T>>>;
|
|
4
4
|
type Events<T> = {
|
|
5
5
|
pop: {
|
|
@@ -74,10 +74,10 @@ declare const _default: <T>(input: T[], options?: Options) => {
|
|
|
74
74
|
sort: ((compareFn?: ((a: Infer<T>, b: Infer<T>) => number) | undefined) => Infer<T>[] & {
|
|
75
75
|
readonly constructor: Function;
|
|
76
76
|
length: number;
|
|
77
|
-
dispatch: <E extends keyof Events<
|
|
77
|
+
dispatch: <E extends keyof Events<T_1>>(event: E, data?: Events<T>[E] | undefined) => void;
|
|
78
78
|
dispose: () => void;
|
|
79
|
-
on: <E extends keyof Events<
|
|
80
|
-
once: <E extends keyof Events<
|
|
79
|
+
on: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
80
|
+
once: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
81
81
|
at: (i: number) => any;
|
|
82
82
|
indexOf: (value: T) => number;
|
|
83
83
|
map: <U>(fn: (this: any, value: T, i: number) => U, i?: number, n?: number) => U[];
|
|
@@ -125,10 +125,10 @@ declare const _default: <T>(input: T[], options?: Options) => {
|
|
|
125
125
|
fill: (value: Infer<T>, start?: number, end?: number) => Infer<T>[] & {
|
|
126
126
|
readonly constructor: Function;
|
|
127
127
|
length: number;
|
|
128
|
-
dispatch: <E extends keyof Events<
|
|
128
|
+
dispatch: <E extends keyof Events<T_1>>(event: E, data?: Events<T>[E] | undefined) => void;
|
|
129
129
|
dispose: () => void;
|
|
130
|
-
on: <E extends keyof Events<
|
|
131
|
-
once: <E extends keyof Events<
|
|
130
|
+
on: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
131
|
+
once: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
132
132
|
at: (i: number) => any;
|
|
133
133
|
indexOf: (value: T) => number;
|
|
134
134
|
map: <U>(fn: (this: any, value: T, i: number) => U, i?: number, n?: number) => U[];
|
|
@@ -143,10 +143,10 @@ declare const _default: <T>(input: T[], options?: Options) => {
|
|
|
143
143
|
copyWithin: (target: number, start: number, end?: number) => Infer<T>[] & {
|
|
144
144
|
readonly constructor: Function;
|
|
145
145
|
length: number;
|
|
146
|
-
dispatch: <E extends keyof Events<
|
|
146
|
+
dispatch: <E extends keyof Events<T_1>>(event: E, data?: Events<T>[E] | undefined) => void;
|
|
147
147
|
dispose: () => void;
|
|
148
|
-
on: <E extends keyof Events<
|
|
149
|
-
once: <E extends keyof Events<
|
|
148
|
+
on: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
149
|
+
once: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
150
150
|
at: (i: number) => any;
|
|
151
151
|
indexOf: (value: T) => number;
|
|
152
152
|
map: <U>(fn: (this: any, value: T, i: number) => U, i?: number, n?: number) => U[];
|
|
@@ -223,10 +223,10 @@ declare const _default: <T>(input: T[], options?: Options) => {
|
|
|
223
223
|
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
224
224
|
};
|
|
225
225
|
readonly constructor: Function;
|
|
226
|
-
dispatch: <E extends keyof Events<
|
|
226
|
+
dispatch: <E extends keyof Events<T_1>>(event: E, data?: Events<T>[E] | undefined) => void;
|
|
227
227
|
dispose: () => void;
|
|
228
|
-
on: <E extends keyof Events<
|
|
229
|
-
once: <E extends keyof Events<
|
|
228
|
+
on: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
229
|
+
once: <E extends keyof Events<T_1>>(event: E, listener: Listener<Events<T>[E]>) => void;
|
|
230
230
|
};
|
|
231
231
|
export default _default;
|
|
232
232
|
export { API as ReactiveArray };
|
package/build/reactive/array.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isInstanceOf, isNumber, isObject } from '@esportsplus/utilities';
|
|
2
|
-
import { dispose, signal, Reactive } from '../signal';
|
|
3
|
-
import object from './object';
|
|
2
|
+
import { dispose, signal, Reactive } from '../signal.js';
|
|
3
|
+
import object from './object.js';
|
|
4
4
|
class ReactiveArray extends Array {
|
|
5
5
|
options;
|
|
6
6
|
proxy;
|
package/build/reactive/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isArray, isObject } from '@esportsplus/utilities';
|
|
2
|
-
import { default as array } from './array';
|
|
3
|
-
import { default as object } from './object';
|
|
2
|
+
import { default as array } from './array.js';
|
|
3
|
+
import { default as object } from './object.js';
|
|
4
4
|
export default (data, options = {}) => {
|
|
5
5
|
let value;
|
|
6
6
|
if (isArray(data)) {
|
package/build/reactive/object.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineProperty, isArray, isFunction } from '@esportsplus/utilities';
|
|
2
|
-
import { computed, signal } from '../signal';
|
|
3
|
-
import { default as array } from './array';
|
|
2
|
+
import { computed, signal } from '../signal.js';
|
|
3
|
+
import { default as array } from './array.js';
|
|
4
4
|
class ReactiveObject {
|
|
5
5
|
signals = {};
|
|
6
6
|
constructor(data, options = {}) {
|
package/build/resource.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import CustomFunction from '@esportsplus/custom-function';
|
|
2
|
-
import { Options } from './types';
|
|
2
|
+
import { Options } from './types.js';
|
|
3
3
|
declare class Resource<A extends unknown[], R extends Promise<unknown>> extends CustomFunction {
|
|
4
4
|
private arguments;
|
|
5
5
|
private okay;
|
package/build/resource.js
CHANGED
package/build/signal.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Computed, Changed, Effect, Event, Function, Listener, NeverAsync, Options, Root, Scheduler, Signal, State, Type } from './types';
|
|
1
|
+
import { Computed, Changed, Effect, Event, Function, Listener, NeverAsync, Options, Root, Scheduler, Signal, State, Type } from './types.js';
|
|
2
2
|
declare class Reactive<T> {
|
|
3
3
|
changed: Changed | null;
|
|
4
4
|
fn: Computed<T>['fn'] | Effect['fn'] | null;
|
package/build/signal.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isArray } from '@esportsplus/utilities';
|
|
2
|
-
import { CHECK, CLEAN, COMPUTED, DIRTY, DISPOSED, EFFECT, ROOT, SIGNAL } from './constants';
|
|
2
|
+
import { CHECK, CLEAN, COMPUTED, DIRTY, DISPOSED, EFFECT, ROOT, SIGNAL } from './constants.js';
|
|
3
3
|
let index = 0, observer = null, observers = null, scope = null;
|
|
4
4
|
class Reactive {
|
|
5
5
|
changed = null;
|
package/build/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Function, NeverAsync, Prettify } from '@esportsplus/typescript';
|
|
2
|
-
import { ReactiveArray } from './reactive/array';
|
|
3
|
-
import { ReactiveObject } from './reactive/object';
|
|
4
|
-
import { CHECK, CLEAN, COMPUTED, DIRTY, DISPOSED, EFFECT, ROOT, SIGNAL } from './constants';
|
|
5
|
-
import { Reactive } from './signal';
|
|
2
|
+
import { ReactiveArray } from './reactive/array.js';
|
|
3
|
+
import { ReactiveObject } from './reactive/object.js';
|
|
4
|
+
import { CHECK, CLEAN, COMPUTED, DIRTY, DISPOSED, EFFECT, ROOT, SIGNAL } from './constants.js';
|
|
5
|
+
import { Reactive } from './signal.js';
|
|
6
6
|
type Base<T> = Omit<Reactive<T>, 'changed' | 'fn' | 'get' | 'scheduler' | 'set' | 'task' | 'tracking'>;
|
|
7
7
|
type Changed = (a: unknown, b: unknown) => boolean;
|
|
8
8
|
type Computed<T> = {
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"@esportsplus/utilities": "^0.0.8"
|
|
6
6
|
},
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@esportsplus/typescript": "^0.
|
|
8
|
+
"@esportsplus/typescript": "^0.6.3"
|
|
9
9
|
},
|
|
10
10
|
"main": "build/index.js",
|
|
11
11
|
"name": "@esportsplus/reactivity",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"prepublishOnly": "npm run build"
|
|
18
18
|
},
|
|
19
19
|
"types": "build/index.d.ts",
|
|
20
|
-
"version": "0.3.
|
|
20
|
+
"version": "0.3.3"
|
|
21
21
|
}
|