Skip to content

Extending interpreter #1337

Answered by pipex
pipex asked this question in General
Discussion options

You must be logged in to vote

Thanks for the reply @davidkpiano, I understand. I think I did a poor job explaining what I'm trying to do.

I have a system which is a hierarchy of actors, implemented as XState state machines. What I want is to maintain a changeset for each actor, without having to explicitely call the logging function in each state machine.

My first thought was to extend Interpreter, in such a way that it is the custom interpreter the one to log the changes for each actor. However, that does not work since I would need spawnMachine to return a custom interpreter as well so all levels of the tree get logged.

My plan now is to create a spawnWithProxy method, that spawns a "proxy" actor for each child acto…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pipex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants