-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way for flags decoding to fail #17
Comments
Another thing to consider would be potentially asynchronously initializing. Some applications must perform effects before they can be properly started (even the good old |
I guess something like a "applicationWithLoader" would do the trick. |
Hey @gampleman , |
Looks pretty good, I'll try to use it in our app tomorrow/next week and see how it works in practice. On a slightly separate note, I wonder if something like this API sketch would be a useful abstraction for this (if you added flags decoding to it of course). |
Most non-trivial apps need to decode their flags from JSON, but this of course has the property that app initialization can fail if the flags fail to decode properly.
One can of course mitigate this by making their shared type into something like:
but this gets annoying, since we need to deal with pattern matching on this shared type everywhere in the application and basically we don't really need the rest of the application if it fails to initialize, since the only thing we can do is show some sort of error screen.
I would then suggest to change
Spa.application
(or make a new version of it if backwards compatibility is a concern) to something like:This would then present the
errorPage
on flag decoding failure. I've found (we had a private fork some time ago) that there is quite a useful feature whereEffect.catastrophicFailure
can be then added that goes straight to theerrorPage
.Another idea to consider would be to somehow recycle the
defaultView
for this purpose, although I'm not confident the type system would quite allow it.The text was updated successfully, but these errors were encountered: