@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
|
@@ -148,6 +148,17 @@ function snapshotOwnTransitions(source) {
|
|
|
148
148
|
return Object.fromEntries(entries);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
// src/base.ts
|
|
152
|
+
var MachineBase = class {
|
|
153
|
+
/**
|
|
154
|
+
* Initializes a new machine instance with its starting context.
|
|
155
|
+
* @param context - The initial state of the machine.
|
|
156
|
+
*/
|
|
157
|
+
constructor(context) {
|
|
158
|
+
this.context = context;
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
|
|
151
162
|
// src/generators.ts
|
|
152
163
|
function run(flow, initial) {
|
|
153
164
|
const generator = flow(initial);
|
|
@@ -1842,15 +1853,6 @@ function runMachine(initial, onChange) {
|
|
|
1842
1853
|
}
|
|
1843
1854
|
};
|
|
1844
1855
|
}
|
|
1845
|
-
var MachineBase = class {
|
|
1846
|
-
/**
|
|
1847
|
-
* Initializes a new machine instance with its starting context.
|
|
1848
|
-
* @param context - The initial state of the machine.
|
|
1849
|
-
*/
|
|
1850
|
-
constructor(context) {
|
|
1851
|
-
this.context = context;
|
|
1852
|
-
}
|
|
1853
|
-
};
|
|
1854
1856
|
function next(m, update) {
|
|
1855
1857
|
return setContext(m, (ctx) => update(ctx));
|
|
1856
1858
|
}
|