mirror of
https://github.com/leptos-rs/leptos.git
synced 2025-12-27 09:54:41 -05:00
This commit is contained in:
@@ -440,7 +440,14 @@ pub fn FileUploadWithProgress() -> impl IntoView {
|
|||||||
let mut entry =
|
let mut entry =
|
||||||
FILES.entry(filename.to_string()).or_insert_with(|| {
|
FILES.entry(filename.to_string()).or_insert_with(|| {
|
||||||
println!("[{filename}]\tinserting channel");
|
println!("[{filename}]\tinserting channel");
|
||||||
let (tx, rx) = broadcast(128);
|
// NOTE: this channel capacity is set arbitrarily for this demo code.
|
||||||
|
// it allows for up to exactly 1048 chunks to be sent, which sets an upper cap
|
||||||
|
// on upload size (the precise details vary by client)
|
||||||
|
// in a real system, you will want to create some more reasonable ways of
|
||||||
|
// sending and sharing notifications
|
||||||
|
//
|
||||||
|
// see https://github.com/leptos-rs/leptos/issues/4397 for related discussion
|
||||||
|
let (tx, rx) = broadcast(1048);
|
||||||
File { total: 0, tx, rx }
|
File { total: 0, tx, rx }
|
||||||
});
|
});
|
||||||
entry.total += len;
|
entry.total += len;
|
||||||
|
|||||||
Reference in New Issue
Block a user