Attaching metadata to effects #672
lukeredpath
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A technique we have adopted in our app is to record some errors published by our effects to our error/crash reporting tool - this is done with a custom operator that uses "handleEvents" to intercept errors and record them using the error reporting SDK.
This custom operator takes a descriptive string that lets us label the effects and we use this to set some metadata on the reported error so we can filter or group errors in the tool by the effect that generated them which is really useful - because of the way effects are executed there isn't really a useful backtrace because effects are always executed by the store internals.
This has got me thinking that it would generally be useful to attach arbitrary metadata to an Effect for debugging purposes, whether that's when printing/inspecting effects in the debugger or reporting errors as described above.
Would there be any interest in adding some kind of API to effect to support this? At the very least I think it would be useful if the metadata included the action that triggered the effect, but providing an API to allow any arbitrary key/value pairs would also be useful. I'd be happy to explore this and open a PR if this is considered something that would be generally useful.
Beta Was this translation helpful? Give feedback.
All reactions