LiveReactNative.Upload (live_react_native v0.0.3)
View SourceLibrary-owned, LiveView-shaped mobile upload support (server mode). Mirrors
allow_upload/consume_uploads names but is built on Phoenix's patterns, not its
private Phoenix.LiveView.Upload* modules. State lives as a plain (non-change-tracked)
assign under :__mobile_uploads__; progress is reported client-side, so this state is
never diffed to the phone.
Summary
Functions
Register an upload config (call in the LiveView mount, on the socket).
Append a base64 chunk to the entry's temp file.
Consume the DONE entries for name: call fun.(%{path: tmp}, entry) for each,
collect the returns, delete the temp files, and drop the entries. Returns
{results, socket}.
Delete all staged temp files and clear upload entries (call on channel terminate).
Mark an entry complete.
Validate + open a temp file for an incoming entry. Payload has string keys.
Functions
Register an upload config (call in the LiveView mount, on the socket).
Append a base64 chunk to the entry's temp file.
Consume the DONE entries for name: call fun.(%{path: tmp}, entry) for each,
collect the returns, delete the temp files, and drop the entries. Returns
{results, socket}.
Delete all staged temp files and clear upload entries (call on channel terminate).
Mark an entry complete.
Validate + open a temp file for an incoming entry. Payload has string keys.