@doeixd/machine 0.0.20 → 0.0.22
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/README.md +19 -0
- package/dist/cjs/development/core.js.map +1 -1
- package/dist/cjs/development/index.js +277 -0
- package/dist/cjs/development/index.js.map +4 -4
- package/dist/cjs/production/index.js +4 -4
- package/dist/esm/development/core.js.map +1 -1
- package/dist/esm/development/index.js +277 -0
- package/dist/esm/development/index.js.map +4 -4
- package/dist/esm/production/index.js +4 -4
- package/dist/types/actor.d.ts +153 -0
- package/dist/types/actor.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mixins.d.ts +118 -0
- package/dist/types/mixins.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/actor.ts +284 -0
- package/src/index.ts +18 -2
- package/src/mixins.ts +308 -0
- package/src/react.ts +95 -124
package/README.md
CHANGED
|
@@ -807,6 +807,25 @@ const alice = buildUser({ id: 1, name: "Alice" });
|
|
|
807
807
|
const bob = buildUser({ id: 2, name: "Bob" });
|
|
808
808
|
```
|
|
809
809
|
|
|
810
|
+
#### `MachineUnion(...classes)`
|
|
811
|
+
|
|
812
|
+
Combines multiple `MachineBase` classes into a single class with merged context and methods. Provides true multiple inheritance for state machines.
|
|
813
|
+
|
|
814
|
+
```typescript
|
|
815
|
+
class Combined extends MachineUnion(Machine1, Machine2) {}
|
|
816
|
+
// Or use instances: const combined = machineUnion(inst1, inst2);
|
|
817
|
+
```
|
|
818
|
+
|
|
819
|
+
#### `MachineExclude(Source, Excluded)`
|
|
820
|
+
|
|
821
|
+
Creates a new machine class by excluding methods from a source machine.
|
|
822
|
+
|
|
823
|
+
```typescript
|
|
824
|
+
// Create a machine that has all Source features EXCEPT those in Excluded
|
|
825
|
+
class Restricted extends MachineExclude(Source, Excluded) {}
|
|
826
|
+
// Or use instances: const restricted = machineExclude(sourceInst, excludedInst);
|
|
827
|
+
```
|
|
828
|
+
|
|
810
829
|
### Middleware System
|
|
811
830
|
|
|
812
831
|
For production-ready state machines with logging, analytics, validation, error handling, and debugging capabilities:
|