XState machine to extract a File
from an html input
with type="file"
.
The machine has an "upload-file"
event that accept event
from onChange
on input
. Inside an actor the HtmlChangeEvent
effect service extract the first File
.
The File
is then stored inside the machine context
. In case of error we store a submitError
.
The machine can be extended by adding logic inside the actor (for example uploading the File
somewhere).