Log with events instead of passed Logger #39
woutermont
started this conversation in
Ideas
Replies: 1 comment
-
+ 1, I don't like having to pass around the logger in components. (Same for the translator actually) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Now we're still in a very fresh stage, I'd opt for a logging mechanism similar to the alerts/notifications (and probably also the errors), using events from XState or the underlying HTML elements to notify a top-level logger of something that needs to be logged. Just like with the current abstraction, this allows us to implement the actual logger any way we want, but it avoids having to pass the Logger everywhere.
XState already has this mechanism using a console logger behind the Log Action, but we can of course substitute this by whatever action we want.
@lem-onade @wouteraj
Beta Was this translation helpful? Give feedback.
All reactions