{"id":28753178,"url":"https://github.com/dioxus-community/dioxus-use-computed","last_synced_at":"2025-09-03T21:34:58.329Z","repository":{"id":245869946,"uuid":"819387775","full_name":"dioxus-community/dioxus-use-computed","owner":"dioxus-community","description":"Run resource-expensive computations in the most efficient way possible in Dioxus 🧬 apps 🦀.","archived":false,"fork":false,"pushed_at":"2024-12-10T10:36:22.000Z","size":72,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T12:42:03.208Z","etag":null,"topics":["dioxus","gui","memoization","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dioxus-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-06-24T12:03:04.000Z","updated_at":"2024-12-10T10:34:51.000Z","dependencies_parsed_at":"2024-06-24T15:21:46.350Z","dependency_job_id":"2ec80afa-ce48-4f13-b5ec-3bde08a39d12","html_url":"https://github.com/dioxus-community/dioxus-use-computed","commit_stats":null,"previous_names":["dioxus-community/dioxus-use-computed"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dioxus-community/dioxus-use-computed","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-use-computed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-use-computed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-use-computed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-use-computed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dioxus-community","download_url":"https://codeload.github.com/dioxus-community/dioxus-use-computed/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-use-computed/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273515065,"owners_count":25119478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dioxus","gui","memoization","rust"],"created_at":"2025-06-17T00:38:57.616Z","updated_at":"2025-09-03T21:34:58.287Z","avatar_url":"https://github.com/dioxus-community.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Discord Server](https://img.shields.io/discord/899851952891002890.svg?logo=discord\u0026style=flat-square)](https://discord.gg/sKJSVNSCDJ)\r\n\r\n# `dioxus-use-computed` 🦀🧠\r\n\r\nAlternative to the built-in [Dioxus](https://dioxuslabs.com/) hooks `use_memo` and `use_reactive`.\r\n\r\nThe main idea is to make resource-expensive computations in the most efficient way possible. Avoiding unnecessary rerenders and wrappers.\r\n\r\n```rs\r\nfn app() -\u003e Element {\r\n    let mut value = use_signal(|| 2);\r\n\r\n    rsx!(\r\n        Counter {\r\n            value: value()\r\n        }\r\n        PrevCounter {\r\n            value: value()\r\n        }\r\n        CounterSignal {\r\n            value: value()\r\n        }\r\n        PrevCounterSignal {\r\n            value: value()\r\n        }\r\n    )\r\n}\r\n\r\n#[component]\r\nfn Counter(value: usize) -\u003e Element {\r\n    let double = use_computed(value, || value * 2);\r\n\r\n    rsx!( p {  \"Double: {double}\" } )\r\n}\r\n\r\n#[component]\r\nfn PrevCounter(value: usize) -\u003e Element {\r\n    let double = use_computed_with_prev(value, |prev_value| prev_value.unwrap_or(value) * 2);\r\n\r\n    rsx!( p { \"Previous Double: {double}\" } )\r\n}\r\n\r\n#[component]\r\nfn CounterSignal(value: usize) -\u003e Element {\r\n    let double = use_computed_signal(value, || value * 2);\r\n\r\n    rsx!( p { \"Double Signal: {double}\" } )\r\n}\r\n\r\n#[component]\r\nfn PrevCounterSignal(value: usize) -\u003e Element {\r\n    let double = use_computed_signal_with_prev(value, |prev| prev.cloned().unwrap_or(value) * 2);\r\n\r\n    rsx!( p { \"Previous Double Signal: {double}\" } )\r\n}\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioxus-community%2Fdioxus-use-computed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdioxus-community%2Fdioxus-use-computed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioxus-community%2Fdioxus-use-computed/lists"}