Skip to content

Commit 3c568f2

Browse files
committed
More formatting and verbiage tweaks
1 parent ea6281b commit 3c568f2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ turbo_boost.state[:key]
573573

574574
```erb
575575
<%
576+
# view
576577
turbo_boost.state[:key] = "value"
577578
turbo_boost.state[:key]
578579
#=> "value"
@@ -605,6 +606,7 @@ turbo_boost.state.now[:key]
605606

606607
```erb
607608
<%
609+
# view
608610
turbo_boost.state.now[:key] = "value"
609611
turbo_boost.state.now[:key]
610612
#=> "value"
@@ -616,7 +618,7 @@ turbo_boost.state.now[:key]
616618
Client-State is a mutable version of the signed Server-State, wrapped in an observable JavaScript proxy.
617619
This allows for sophisticated techniques like data binding via custom JavaScript, Stimulus controllers, or web components.
618620

619-
Client-side state enables immediate UI updates, providing a fast and smooth user experience while the server
621+
Client-State enables immediate UI updates, providing a fast and smooth user experience while the server
620622
[resolves state](#state-resolution) differences whenever Commands are invoked.
621623

622624
Client-State can be accessed on the client like so.
@@ -630,7 +632,7 @@ TurboBoost.State.current['key']
630632
### Page-State
631633

632634
Page-State is managed by the client and used to remember element attribute values between server renders.
633-
It’s best for tracking transient user interactions, like which elements are visible, open/closed, their position, etc.
635+
It’s best for tracking transient user interactions, such as - which elements are visible, open/closed, their position, etc.
634636

635637
This enhances the user experience by maintaining the state of UI elements between renders.
636638
When invoking commands, the client sends the Page-State to the server, allowing it to preserve element attributes when rendering.
@@ -645,13 +647,13 @@ You can opt-in to remember Page-State with Rails tag helpers via the `turbo_boos
645647
<% end %>
646648
```
647649

648-
_This remembers whether the `details` element is open or closed._
650+
This will remember whether the `details` element is open or closed.
649651

650652
__That's it!__ You're done.
651653

652654
> [!NOTE]
653-
> Page-State tracking works with all element attributes, including `aria` and `data`,
654-
> but elements must have a unique `id` to participate in Page-State tracking.
655+
> Page-State tracking works with all element attributes, including `aria`, `data`, and even custom attributes.
656+
> Elements must have a unique `id` to participate in Page-State tracking.
655657
656658
### State Resolution
657659

0 commit comments

Comments
 (0)