Releases: statelyai/xstate
xstate@5.11.0
Minor Changes
-
#4806
f4e0ec48c
Thanks @davidkpiano! - Inline actor logic is now permitted when named actors are present. Defining inline actors will no longer cause a TypeScript error:const machine = setup({ actors: { existingActor: fromPromise(async () => { // ... }) } }).createMachine({ invoke: { src: fromPromise(async () => { // Inline actor }) // ... } });
xstate@5.10.0
Minor Changes
-
#4822
f7f1fbbf3
Thanks @davidkpiano! - Theclock
andlogger
specified in theoptions
object ofcreateActor(logic, options)
will now propagate to all actors created within the same actor system.import { setup, log, createActor } from 'xstate'; const childMachine = setup({ // ... }).createMachine({ // ... // Uses custom logger from root actor entry: log('something') }); const parentMachine = setup({ // ... }).createMachine({ // ... invoke: { src: childMachine } }); const actor = createActor(parentMachine, { logger: (...args) => { // custom logger for args } }); actor.start();
@xstate/store@0.0.3
Patch Changes
-
#4842
3a57f4c69
Thanks @davidkpiano! - Update README.md -
#4839
4a22edb90
Thanks @davidkpiano! - Update JS docs
@xstate/store@0.0.2
Patch Changes
-
#4752
8a32374e7
Thanks @davidkpiano! - Initial release of@xstate/store
import { createStore } from '@xstate/store'; const store = createStore( // initial context { count: 0, greeting: 'hello' }, // transitions { inc: { count: (context) => context.count + 1 }, updateBoth: { count: () => 42, greeting: 'hi' } } ); store.send({ type: 'inc' }); console.log(store.getSnapshot()); // Logs: // { // status: 'active', // context: { // count: 1, // greeting: 'hello' // } // }
xstate@5.9.1
xstate@5.9.0
Minor Changes
-
#4746
b570ba20d
Thanks @davidkpiano! - The newemit(…)
action creator emits events that can be received by listeners. Actors are now event emitters.import { emit } from 'xstate'; const machine = createMachine({ // ... on: { something: { actions: emit({ type: 'emitted', some: 'data' }) } } // ... }); const actor = createActor(machine).start(); actor.on('emitted', (event) => { console.log(event); }); actor.send({ type: 'something' }); // logs: // { // type: 'emitted', // some: 'data' // }
-
#4777
4abeed9df
Thanks @Andarist! - Added support forparams
toenqueueActions
xstate@5.8.2
xstate@5.8.1
@xstate/vue@3.1.1
Patch Changes
- #4759
f112081b9
Thanks @davidkpiano! - Fixsend(…)
type foruseActor(…)