@expressive/mvc 0.35.0 → 0.35.1
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.ts +3 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -28,8 +28,8 @@ declare namespace Model {
|
|
|
28
28
|
current: T | null;
|
|
29
29
|
};
|
|
30
30
|
/** A callback function which is subscribed to parent and updates when values change. */
|
|
31
|
-
type Effect<T> = (this: T, argument: T) =>
|
|
32
|
-
type Event = (this: Model, key: string, value: unknown) =>
|
|
31
|
+
type Effect<T> = (this: T, argument: T) => (() => void) | Promise<void> | null | void;
|
|
32
|
+
type Event = (this: Model, key: string, value: unknown) => (() => void) | void;
|
|
33
33
|
namespace Instruction {
|
|
34
34
|
type Getter<T> = (source: Model) => T;
|
|
35
35
|
type Setter<T> = (value: T, previous: T) => boolean | void | (() => T);
|
|
@@ -58,7 +58,7 @@ declare class Model {
|
|
|
58
58
|
/** Pull current values from state. Flattens all models and exotic values amongst properties. */
|
|
59
59
|
get(): Model.Export<this>;
|
|
60
60
|
/** Run a function which will run automatically when accessed values change. */
|
|
61
|
-
get(effect: Model.Effect<this>):
|
|
61
|
+
get(effect: Model.Effect<this>): () => void;
|
|
62
62
|
get<T extends string>(key: T, required: true): Exclude<Model.ValueOf<this, T>, undefined>;
|
|
63
63
|
get<T extends string>(key: T, required?: boolean): Model.ValueOf<this, T>;
|
|
64
64
|
/**
|
package/package.json
CHANGED