xstate
xstate copied to clipboard
Minor LifecycleSignal-related cleanup
Just some minor cleanup of redundant~ checks, followup to https://github.com/davidkpiano/xstate/pull/2242
⚠️ No Changeset found
Latest commit: 027d600ca72c75b95af303ca62118d7e83b8e74b
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
There are more potential signals than starting and stopping:
// from XActor + Akka
export type ActorSignal =
| { type: ActorSignalType.Start }
| { type: ActorSignalType.PostStop }
| { type: ActorSignalType.Watch; ref: ActorRef<any> }
| { type: ActorSignalType.Terminated; ref: ActorRef<any> }
| { type: ActorSignalType.Subscribe; ref: ActorRef<any> }
| { type: ActorSignalType.Emit; value: any };
We have three choices:
- Give each of these signals their own method, like
.start()and.stop()(not a fan of this idea) - Add a
.receiveSignal(...)method just for these signals (would revert the previous PR, also not a fan) - Handle signals in
.receive(...)(no change, current behavior)
Is this still applicable?
Sort of, I think it's worth re-examining how we handle those signals today and maybe making some changes related to that. I will have to take a look at the exact shape of this PR and next to assess how applicable this PR really is in its current form
Closing as stale