docs: examples
This commit is contained in:
1 parent
818043e5e4
commit
d9e6d0925b
33 files changed
+732
-152
No files matched your search
+28
-23
@@ -1,26 +1,31 @@
|
||||
//! A Showcase of all the useful examples
|
||||
//!
|
||||
//!
|
||||
//! Example: Reference Showcase
|
||||
//! ---------------------------
|
||||
//!
|
||||
//! This example provides a cute interface for browsing the reference examples.
|
||||
|
||||
fn main() {
|
||||
use_css_consumer(&cx, "mystyle");
|
||||
|
||||
// at the global head of the app
|
||||
use_css_provider(&cx, |cfg| {});
|
||||
use_recoil_provider(&cx, |cfg| {});
|
||||
|
||||
let recoil = use_recoil_api(&cx, |_| {});
|
||||
use_websocket_connection(&cx, move |cfg| {
|
||||
cfg.on_receive(move |event| match event.data::<Msg>() {
|
||||
Ok(msg) => match msg {
|
||||
a => recoil.set(&ATOM, 10),
|
||||
c => recoil.set(&ATOM, 20),
|
||||
_ => {}
|
||||
},
|
||||
Err(e) => {}
|
||||
});
|
||||
cfg.on_close(move |event| {});
|
||||
cfg.on_open(move |event| {});
|
||||
});
|
||||
mod reference {
|
||||
mod antipatterns;
|
||||
mod basics;
|
||||
mod children;
|
||||
mod conditional_rendering;
|
||||
mod controlled_inputs;
|
||||
mod custom_elements;
|
||||
mod empty;
|
||||
mod fiber;
|
||||
mod fragments;
|
||||
mod global_css;
|
||||
mod inline_styles;
|
||||
mod iterators;
|
||||
mod listener;
|
||||
mod memo;
|
||||
mod noderefs;
|
||||
mod signals;
|
||||
mod spreadpattern;
|
||||
mod statemanagement;
|
||||
mod suspense;
|
||||
mod testing;
|
||||
mod tostring;
|
||||
mod webcomponents;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
Reference in new issue
Block a user