diff --git a/packages/core/examples/borrowed.rs b/packages/core/examples/borrowed.rs index adce4232f..310052172 100644 --- a/packages/core/examples/borrowed.rs +++ b/packages/core/examples/borrowed.rs @@ -1,5 +1,9 @@ //! Demonstrate that borrowed data is possible as a property type //! Borrowing (rather than cloning) is very important for speed and ergonomics. +//! +//! It's slightly more advanced than just cloning, but well worth the investment. +//! +//! If you use the FC macro, we handle the lifetimes automatically, making it easy to write efficient & performant components. fn main() {} diff --git a/packages/core/examples/showcase.rs b/packages/core/examples/showcase.rs new file mode 100644 index 000000000..17bdae209 --- /dev/null +++ b/packages/core/examples/showcase.rs @@ -0,0 +1,18 @@ +//! The book of patterns +//! ----- +//! +//! This "book" shows a bunch of useful patterns, ergonomic highlights, and quirks for common usecases when building components. +//! +//! Here's what's in the book: +//! - [ ] Use the builder pattern directly instead of the macro +//! - [ ] Using statics instead of functions for components without type hassle. +//! - [ ] Use the FC macro on statics and fns for inling props +//! - [ ] Using borrowed data from parent to child +//! +//! Running this example will generate a beautiful webpage. This webpage is used on the diouxs website. + +fn main() {} + +mod static_usage {} +mod fc_macro {} +mod borrowed_data {}