Commit Graph
38 Commits
Author SHA1 Message Date
Evan Almloff 9ffd4b816b Fix restarting coroutines (#3005)
* Fix restarting coroutines

* Fix popup example
2024-10-03 18:48:26 -05:00
Evan Almloff effc0a3b94 Make use_callback and Callback bring the runtime with them (#2852)
* Move the runtime along with Callback
2024-08-20 14:58:53 -07:00
Evan Almloff b47a6cf83e Move to a generic GlobalLazy<T> (#2851)
* Expose a generic lazy type

* Switch to generic lazy globals

* simplify global lazy context a bit

* rename LazyGlobal to Global

* use Memo::global in more examples

* Fix soundness issue with deref_impl. It relies on the size of self, so it cannot be safe

* add a comment about safety

* Make clippy happy

* fix formatting

* Restore changes to signal impl

* Add helper methods for global signal and global memo to make getting the inner value easier
2024-08-16 17:57:41 -05:00
Matt Hunzinger 205d8e9070 Add argument to use_callback (#2774) 2024-08-02 16:15:59 -07:00
Jonathan Kelley e42b71b1ba Fix #2612: adjust readable trait to allow try_peek (#2714)
* Fix #2612: adjust readable trait to allow try_peek

Our implementation for Readable was inconsistent.
We had a try_unchecked variant for read but not for peek.
This resolves that by making a breaking change to the
Readable interface.

* fix doctests too
2024-07-26 18:20:16 -05:00
Evan Almloff 0127501dbf Improve inline docs (#2460)
Improve inline docs

* improve incorrect event handler return error message

* Improve event handler docs

* document the eval functions

* document spawn and common spawn errors

* fix event handler docs

* add notes about how you use attributes and elements in rsx

* add doc aliases for attributes and events we rename

* add some more aliases for common search terms

* don't doc ignore any public examples in core

* don't ignore public doc examples in ssr

* don't ignore examples in the dioxus package readme

* add a warning when you launch without a renderer enabled

* fix some outdated element docs

* add a bunch of examples to resource

* add notes about desktop events

* add more docs for use_resource

* add on_unimplemented hint to Dependency

* fix some unresolved links

* add examples to each of the router traits

* add not implemented errors for router traits

* add an example to the routable trait

* expand rsx macro docs

* improve memo docs

* update the dioxus readme

* mention dioxus crate features in the docs

* fix a bunch of doc tests

* fix html doc tests

* fix router doc tests

* fix dioxus signals doc tests

* fix dioxus ssr doc tests

* fix use_future example in the hooks cheat sheet

* add a javascript alias for eval

* fix hook explanation values

* remove unused embed-doc-image dependency
2024-06-06 18:15:17 -07:00
Evan Almloff 1d72ef16c4 Restore set compare hook (#2287)
* restore set compare hook

* fix use_set_compare doc example

* add a hook to compare a value with a set

* implement partialeq for SetCompare

* export the new hook

* fix the use_set_compare hook
2024-04-26 11:55:11 -04:00
Evan Almloff f51b5617e1 add a test for the memo hook 2024-03-11 15:33:46 -05:00
Evan Almloff ffc49530f6 implement readable and callable for all structs in the hooks crate 2024-03-08 11:17:28 -06:00
Evan Almloff 287416cfa7 rename flush_sync to wait_for_next_render 2024-03-04 19:52:17 -06:00
Andrey 1404009edc touchups 2024-02-28 03:48:52 +00:00
andrey 70136b22ea Fix error in examples/future.rs comments, use_futures inline docs comments, also added clarification that Signal<T>.read() and Singal<T>() are the same thing 2024-02-28 11:42:04 +08:00
andrey 5a73147d69 added better documentation and code snipppets for the use_resource, use_future, use_effect and use_context hooks 2024-02-27 10:36:05 +08:00
andrey df0d45be48 added better documentation and code snipppets for the use_resource, use_future, use_effect and use_context hooks 2024-02-27 10:15:38 +08:00
Jonathan Kelley 4a7fe938ad Make clippy happy 2024-02-04 23:03:52 -08:00
Jonathan Kelley 8a38a41512 fix use_future todos! 2024-02-02 14:17:53 -08:00
Jonathan Kelley 0fd7799bc2 disable use_future on the server 2024-02-02 13:36:19 -08:00
Jonathan Kelley 7c2947a131 Implement effects using reactivecontext 2024-02-01 13:21:52 -08:00
Jonathan Kelley 0c71b95e82 skeleton of use_server_future with reactivity 2024-02-01 13:21:52 -08:00
Jonathan Kelley 44966efde2 use_future works 2024-01-31 16:56:58 -08:00
Jonathan Kelley 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
Jonathan Kelley a72c035de4 Fix cargo check on examples 2024-01-30 17:59:57 -08:00
Jonathan Kelley 8cc17dc1bd Fix compile 2024-01-29 17:03:50 -08:00
Jonathan Kelley dcdada542b Properly implement wait_for_suspense
Wait_for_suspense now does not call flush_sync, making it
appropriate for deferring effects on the server. Futures will
still run on the server (as needed to progress suspense)
but use_effect / and memo watchers will not run on the server
2024-01-29 14:12:05 -08:00
Jonathan Kelley 1847c737e9 Queue effects to run after flush_sync 2024-01-28 02:21:05 -08:00
Jonathan Kelley 974680796f add test cases, refactor deref 2024-01-26 23:05:40 -08:00
Jonathan Kelley c0522bc152 cargo check all 2024-01-23 16:58:29 -08:00
Evan Almloff c51badf07b fix use hooks with impl signals 2024-01-23 10:09:02 -06:00
Jonathan Kelley 028f499bf6 Fix generational box in release mode 2024-01-21 12:46:19 -08:00
Jonathan Kelley 8559984e9d and mut bound to mut methods on signals 2024-01-15 23:24:59 -08:00
Jonathan Kelley bb750f5336 Fix effect stack issue 2024-01-15 20:45:59 -08:00
Jonathan Kelley a32ae8b112 Remove push_future, get use_future kinda working again 2024-01-15 19:34:04 -08:00
Jonathan Kelley 74aa55f85f Bring back mroe hooks, remove old hooks, cleanup a number of examples 2024-01-15 17:04:39 -08:00
Jonathan Kelley 1dde044697 remove cx.render 2024-01-13 21:12:21 -08:00
Jonathan Kelley fae0b08e61 Fix the router and stub out a number of crates to get compiling 2024-01-13 20:51:37 -08:00
Evan Almloff 3865f44081 make desktop compile 2024-01-05 14:39:45 -06:00
Exotik850 18fa1e4831 Make UseFuture Clone, factor out dependencies field (#1666) 2023-11-27 15:42:48 -06:00
Leonard a2dd926f7f Rename modules to use snake_case (#1498) 2023-09-26 17:20:29 -05:00