From 535bcfad1059a1a22bb6047de3953170a7963885 Mon Sep 17 00:00:00 2001 From: Keith Date: Wed, 17 Apr 2024 03:04:28 -0700 Subject: [PATCH] Update crates/ui/docs/hello-world.md TODO with explanation of SharedString usage (#10664) Filled out a comment where there was a TODO to explain SharedString usage. Release Notes: - N/A --- crates/ui/docs/hello-world.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui/docs/hello-world.md b/crates/ui/docs/hello-world.md index 12ee4d7aba..a13331e11f 100644 --- a/crates/ui/docs/hello-world.md +++ b/crates/ui/docs/hello-world.md @@ -40,7 +40,7 @@ impl TodoList { All of this is relatively straightforward. -We use [gpui::SharedString] in components instead of [std::string::String]. This allows us to [TODO: someone who actually knows please explain why we use SharedString]. +We use [gpui::SharedString] in components instead of [std::string::String]. This allows us to efficiently handle shared string data across multiple components and threads without the performance overhead of copying strings. When we want to pass an action we pass a `ClickHandler`. Whenever we want to add an action, the struct it belongs to needs to be generic over the view type `V`.