Skip to content

Commit

Permalink
Clarify sharing of inputs (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jan 30, 2023
1 parent 76824d4 commit 07bbfdf
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions lib/kino/input.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ defmodule Kino.Input do
name = Kino.Input.read(input)
All inputs are shared by default: once you change the input,
your changes will be immediately replicated to all users
reading the notebook. Use `Kino.Control.form/2` if you want
each user to have their own input.
## Async API
You can subscribe to input changes or use the `Stream`
Expand Down Expand Up @@ -282,6 +287,13 @@ defmodule Kino.Input do
Note that the value can also be `nil`, if no image is selected.
> ### Warning {.warning}
>
> The image input is shared by default: once you upload a image,
> the image will be replicated to all users reading the notebook.
> Use `Kino.Control.form/2` if you want each user to have a distinct
> image upload with an explicit submission button.
## Options
* `:format` - the format to read the image as, either of:
Expand Down Expand Up @@ -358,6 +370,13 @@ defmodule Kino.Input do
Note that the value can also be `nil`, if no audio is selected.
> ### Warning {.warning}
>
> The audio input is shared by default: once you upload an audio,
> the audio will be replicated to all users reading the notebook.
> Use `Kino.Control.form/2` if you want each user to have a distinct
> audio upload with an explicit submission button.
## Options
* `:format` - the format to read the audio as, either of:
Expand Down Expand Up @@ -397,6 +416,13 @@ defmodule Kino.Input do
Note that the value can also be `nil`, if no file is selected.
> ### Warning {.warning}
>
> The file input is shared by default: once you upload a file,
> the file will be replicated to all users reading the notebook.
> Use `Kino.Control.form/2` if you want each user to have a distinct
> file upload with an explicit submission button.
## Options
* `:accept` - the list of accepted file types (either extensions
Expand Down

0 comments on commit 07bbfdf

Please sign in to comment.