Commit Graph
35 Commits
Author SHA1 Message Date
Matt Hunzinger 205d8e9070 Add argument to use_callback (#2774) 2024-08-02 16:15:59 -07:00
Evan Almloff b6dc2a2230 Deduplicate reactive scope updates/Reset subscriptions on reruns/fix use memo double update (#2506)
* deduplicate effect updates

* only subscribe to signals read in the current run of reactive scopes

* subscribe to memo reads after recomputing the value
2024-06-18 18:49:25 -07: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 5290b658fd Fix effects triggered from async tasks; improve work scheduling docs (#2370)
* outline work scheduling

* move scheduling code from dirty_scope to scheduler

* introduce queue_effect

* Run effects after all tasks are polled if there are no components rerendered

* add a new test for async effects
2024-05-04 15:30:13 +01:00
Evan Almloff 5ce91e1bfc Fix flakey windows tests (#2332) 2024-04-17 15:08:38 -07:00
Evan Almloff df41df75d0 switch to use_reactive 2024-03-15 11:54:09 -05:00
Evan Almloff 80aeba30c7 Merge branch 'main' into resource-dependancies 2024-03-13 10:03:44 -05:00
Evan Almloff 3866aa2977 simplify use_dependencies docs 2024-03-13 10:03:00 -05:00
Evan Almloff 0951a389f7 add a way to add manual dependency tuple to memos and effects 2024-03-13 09:54:48 -05:00
Evan Almloff f51b5617e1 add a test for the memo hook 2024-03-11 15:33:46 -05:00
Evan Almloff 492f0329bf remove flume, implement lazier memos 2024-03-06 11:38:28 -06:00
Evan Almloff 287416cfa7 rename flush_sync to wait_for_next_render 2024-03-04 19:52:17 -06:00
Evan Almloff 3827378f68 Merge branch 'main' into fix-effect 2024-03-04 15:40:37 -06:00
Evan Almloff 78b9b157dc fix formatting 2024-03-04 12:04:09 -06:00
Evan Almloff a14e5be7ad Fix effect ordering after reruns 2024-03-01 12:46:07 -06:00
Jonathan Kelley d61c3fab20 Merge branch 'main' into debug-subscriptions 2024-02-29 12:30:27 -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
Evan Almloff f539698963 add debug information for signal subscriptions 2024-02-26 11:46:01 -06:00
Evan Almloff 91fea15cdc don't expose the signal scope subscriber API publicly 2024-02-05 08:13:52 -06:00
Jonathan Kelley 4a7fe938ad Make clippy happy 2024-02-04 23:03:52 -08:00
Jonathan Kelley 8f70a84c70 Use futures_util mutex instead of flume for sending flush lock wakeups 2024-02-02 13:09:26 -08:00
Jonathan Kelley dd06705ff1 implement use_async_memo with reactive context 2024-02-01 13:21:53 -08:00
Jonathan Kelley 7c2947a131 Implement effects using reactivecontext 2024-02-01 13:21:52 -08:00
Jonathan Kelley cef64d43df move hooks out of signals crate 2024-01-29 17:02:26 -08:00
Jonathan Kelley b291a5c0b0 Remove a number of hooks 2024-01-15 14:51:34 -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 fdce7bbe5a Return to just TaskId, still polling 2023-12-12 13:02:35 -06:00
kidkool850@gmail.com 69ca1fd8a7 Make cx.spawn() return an Option<TaskId>, returns None if finished immediately 2023-12-11 16:01:40 -06:00
ealmloffandMarc Espín 7a459e15d8 Update packages/hooks/src/use_effect.rs
Co-authored-by: Marc Espín <mespinsanz@gmail.com>
2023-11-21 16:28:06 -06:00
Evan Almloff 83f7ef9a44 add an optional cleanup closure to the use effect hook 2023-11-19 09:58:00 -06:00
LeonardandEvan Almloff 30a3283438 Add use_on_mount and fix some typos (#1497)
* Add `use_on_mount` and fix some typos

* Optimize away UseOnMount struct

* `use_on_mount`, `use_on_unmount` -> `use_on_create`, `use_on_destroy`

* Make `use_on_unmount` deprecated

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-10-04 08:23:21 -05:00
Leonard a2dd926f7f Rename modules to use snake_case (#1498) 2023-09-26 17:20:29 -05:00