HYPERBOLE
Intro
Basics
More HyperViews
Concurrency
View Functions
Side Effects
Managing State
Styles
Hyperbole Effect
Requests
Response
Exception Handling
Edge Cases
Handle In Views
Custom Error Views
Application
Forms
Interactivity
Examples
v0.6.0
Requests
The
Hyperbole
Effect
allows us to skip the normal update cycle to directly access the
Request
or manipulate the
Client
Host: Host {text = "docs.hyperbole.live"}
Path: Path {segments = ["hyperboleeffect"]}
Query: []
Cookies: fromList []
</> Source
Set Query from another HyperView
Clear Query
</> Source
Response
It also allows us to directly affect the response and the javascript client
Redirect Me
Set Page Title
Respond Not Found
Respond Error
</> Source
Exception Handling
Any uncaught exceptions thrown from a handler will be displayed in a bright red box inline in the corresponding HyperView
Cause Exception
</> Source
Edge Cases
You can use the same mechanism to exit execution early and display an application error to handle edge cases
We know all these users exist when the view was rendered, so one going missing is unlikely
User: 1
User: 2
User: 3
If a user were deleted between when they were rendered and loaded, the error would look like this:
Attempt to load non-existing User 4
</> Source
Handle In Views
Handle any expected errors in your view function, by making it accept a Maybe or Either
Search for a user by id
</> Source
Custom Error Views
You can also exit execution early and display a custom view from application code or from caught execptions
Custom Error Message
Custom Error View
</> Source