xstate icon indicating copy to clipboard operation
xstate copied to clipboard

Minor LifecycleSignal-related cleanup

Open Andarist opened this issue 4 years ago • 2 comments

Just some minor cleanup of redundant~ checks, followup to https://github.com/davidkpiano/xstate/pull/2242

Andarist avatar Jun 06 '21 17:06 Andarist

⚠️ 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

changeset-bot[bot] avatar Jun 06 '21 17:06 changeset-bot[bot]

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)

davidkpiano avatar Jun 13 '21 12:06 davidkpiano

Is this still applicable?

davidkpiano avatar Jun 24 '23 18:06 davidkpiano

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

Andarist avatar Jun 24 '23 19:06 Andarist

Closing as stale

davidkpiano avatar Sep 06 '23 05:09 davidkpiano