Add `onError` prop to LiveProvider
I need a way to get the Error object instead of just rendering it through <LiveError />. I couldn't find a way to do this so I thought I'd add simple onError + onRender props to LiveProvider. Devs can then set these handlers if they want to do some custom error handling.
Please let me know if I missed anything or if you don't feel this is a good addition.
I think onError is a good addition! What was the use case for the onRender prop? It seems like you didn't add documentation for it. I'm wondering if there's something we already have that might cover that added functionality?
Just added some more fixes. Forgot about this PR for a while, sorry!
The onRender prop will be called when the error is cleared. You'd need to have some way to know when there is no longer an error. Maybe another name could be better.
I do need to add documentation, agreed!
@sofiapoh I removed onError and changed onRender to include an optional Error argument. I'd love to get your thoughts on this.
This is a great addition. Any update here?