@doeixd/machine 1.0.2 → 1.0.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/dist/cjs/development/core.js +11 -9
- package/dist/cjs/development/core.js.map +3 -3
- package/dist/cjs/development/index.js +11 -9
- package/dist/cjs/development/index.js.map +3 -3
- package/dist/cjs/development/react.js +11 -9
- package/dist/cjs/development/react.js.map +3 -3
- package/dist/cjs/production/core.js +1 -1
- package/dist/cjs/production/index.js +2 -2
- package/dist/cjs/production/react.js +1 -1
- package/dist/esm/development/core.js +11 -9
- package/dist/esm/development/core.js.map +3 -3
- package/dist/esm/development/index.js +11 -9
- package/dist/esm/development/index.js.map +3 -3
- package/dist/esm/development/react.js +11 -9
- package/dist/esm/development/react.js.map +3 -3
- package/dist/esm/production/core.js +1 -1
- package/dist/esm/production/index.js +2 -2
- package/dist/esm/production/react.js +1 -1
- package/dist/types/base.d.ts +56 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/higher-order.d.ts +2 -1
- package/dist/types/higher-order.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -49
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/base.ts +62 -0
- package/src/higher-order.ts +2 -2
- package/src/index.ts +2 -55
|
@@ -24,6 +24,17 @@ function snapshotOwnTransitions(source) {
|
|
|
24
24
|
return Object.fromEntries(entries);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
// src/base.ts
|
|
28
|
+
var MachineBase = class {
|
|
29
|
+
/**
|
|
30
|
+
* Initializes a new machine instance with its starting context.
|
|
31
|
+
* @param context - The initial state of the machine.
|
|
32
|
+
*/
|
|
33
|
+
constructor(context) {
|
|
34
|
+
this.context = context;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
27
38
|
// src/generators.ts
|
|
28
39
|
function run(flow, initial) {
|
|
29
40
|
const generator = flow(initial);
|
|
@@ -2154,15 +2165,6 @@ function runMachine(initial, onChange) {
|
|
|
2154
2165
|
}
|
|
2155
2166
|
};
|
|
2156
2167
|
}
|
|
2157
|
-
var MachineBase = class {
|
|
2158
|
-
/**
|
|
2159
|
-
* Initializes a new machine instance with its starting context.
|
|
2160
|
-
* @param context - The initial state of the machine.
|
|
2161
|
-
*/
|
|
2162
|
-
constructor(context) {
|
|
2163
|
-
this.context = context;
|
|
2164
|
-
}
|
|
2165
|
-
};
|
|
2166
2168
|
function next(m, update) {
|
|
2167
2169
|
return setContext(m, (ctx) => update(ctx));
|
|
2168
2170
|
}
|