@lucy/liblucy 0.7.0 → 0.7.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/lucy.wasm +0 -0
- package/package.json +1 -1
- package/readme.md +1 -1
package/dist/lucy.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -20,7 +20,7 @@ machine.stop();
|
|
|
20
20
|
|
|
21
21
|
- `createMachine({ context, actions, guards, assigns, delays, services })`: the options supply what the Lucy source names with `:symbols`, each called as `(context, event)`; a `services` entry returns a promise for `invoke(:name)` and an unstarted machine for `spawn(:name)`. Only the options a machine uses are read.
|
|
22
22
|
- `state` is the current state's name, or a dotted path such as `'red.walk'` inside a nested machine. `context` is a plain object, replaced (not mutated) by each `assign`. `done` becomes `true` when a final state is entered.
|
|
23
|
-
- `send(event)` takes a type or an `{ type, data }` object and runs the transition at once. `subscribe(listener)` calls the listener with the machine after each change and returns an unsubscribe function. `start()` enters the initial state (entry actions, timers, invokes) and returns the machine; `stop()` clears timers, drops pending invokes, stops invoked and spawned children, and clears the listeners.
|
|
23
|
+
- `send(event)` takes a type or an `{ type, data }` object and runs the transition at once. An event sent while the machine is handling another (from an action, a listener, or an actor it sent to) is queued: it is handled after that transition and its notification, in order, before the outermost `send` returns. If a transition throws, the queue is dropped and the error reaches the caller. A machine that calls no code of its own has no queue. `subscribe(listener)` calls the listener with the machine after each change and returns an unsubscribe function. `start()` enters the initial state (entry actions, timers, invokes) and returns the machine; `stop()` clears timers, drops pending invokes, stops invoked and spawned children, and clears the listeners.
|
|
24
24
|
- Every module comes with a `.d.ts` that types each factory's options and the machine it returns: `lucyc --out-file toggle.js` writes `toggle.d.ts` beside it, and `compile()` returns it as `dts`.
|
|
25
25
|
- `lucyc --ts` (and `compile(source, filename, { format: 'ts' })`, which returns `ts`) compiles to one TypeScript module instead: the same code with those types in it. Its syntax is erasable, so Node runs it as it is. The types are those of the factories; the code inside them is marked `// @ts-nocheck`, as it is generated and uses `any` for the events.
|
|
26
26
|
|