Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository = "https://github.com/Ivy-Interactive/Rusty-Framework"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
tokio = { version = "1", features = ["full"] }
axum = { version = "0.8", features = ["ws"] }
axum = { version = "0.8", features = ["ws", "multipart"] }
futures = "0.3"
uuid = { version = "1", features = ["v4"] }
tracing = "0.1"
Expand Down
2 changes: 2 additions & 0 deletions rusty-docs/docs/02_concepts/03_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Hooks let you add state and side effects to views. They must be called in the sa
| `use_signal` | Send and receive messages between views, per session or server-wide |
| `use_download` | Register a download and get the URL to serve it from |
| `use_download_stream` | Serve a large download as a chunked stream instead of buffering it |
| `use_stream` / `use_stream_text` | Consume an async stream into view state chunk by chunk, with retries |
| `use_upload` / `use_upload_to` | Accept a file from the browser with progress, into view state or a sink |
| `use_alert` | Show a modal alert and get the user's answer in a callback |
| `use_trigger` | Render an element on demand, carrying a value to its factory |

Expand Down
4 changes: 4 additions & 0 deletions rusty-macros/src/hook_rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ pub(crate) const SLOT_CONSUMING_HOOKS: &[&str] = &[
"use_ref",
"use_signal",
"use_state",
"use_stream",
"use_stream_text",
"use_trigger",
"use_trigger_unit",
"use_upload",
"use_upload_to",
];

/// Hooks whose return value triggers a rebuild when mutated.
Expand Down
6 changes: 6 additions & 0 deletions rusty/src/hooks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ pub mod use_ref;
pub mod use_service;
pub mod use_signal;
pub mod use_state;
pub mod use_stream;
pub mod use_trigger;
pub mod use_upload;

pub use deps::{deps_changed, DynEq};
pub use use_alert::{use_alert, AlertCallback, ShowAlert};
Expand All @@ -33,4 +35,8 @@ pub use use_ref::{use_ref, Ref};
pub use use_service::{try_use_service, use_service};
pub use use_signal::{signal_registry, use_receiver_id, use_signal};
pub use use_state::{use_state, State};
pub use use_stream::{
use_stream, use_stream_text, StreamOptions, StreamResult, StreamStatus, TextStreamResult,
};
pub use use_trigger::{use_trigger, use_trigger_unit};
pub use use_upload::{use_upload, use_upload_to, Upload, UploadStatus};
Loading