Skip to content

Commit e758e1a

Browse files
authored
Update once-props.mdx
1 parent 0336f8f commit e758e1a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

v2/data-props/once-props.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ router.reload({ only: ['plans'] })
6262

6363
</CodeGroup>
6464

65-
## Setting an Expiration
65+
## Expiration
6666

6767
You may set an expiration time using the `until()` method. This method accepts a `DateTimeInterface`, `DateInterval`, or an integer (seconds). The prop will be refreshed on a subsequent visit after the expiration time has passed.
6868

@@ -74,7 +74,7 @@ return Inertia::render('Dashboard', [
7474

7575
## Custom Keys
7676

77-
You may assign a custom key using the `as()` method. This is useful when you want to share data across multiple pages while using different prop names.
77+
You may assign a custom key to the prop using the `as()` method. This is useful when you want to share data across multiple pages while using different prop names.
7878

7979
```php
8080
// Team member list...
@@ -98,19 +98,19 @@ You may share once props globally using the `Inertia::share()` method.
9898
Inertia::share('countries', Inertia::once(fn () => Country::all()));
9999
```
100100

101-
Alternatively, you may use the `shareOnce()` helper method for a cleaner syntax.
101+
Or, for convenience, you may use the `shareOnce()` method.
102102

103103
```php
104104
Inertia::shareOnce('countries', fn () => Country::all());
105105
```
106106

107-
You may also chain `as()`, `fresh()`, and `until()` onto this method.
107+
You may also chain `as()`, `fresh()`, and `until()` onto the `shareOnce` method.
108108

109109
```php
110110
Inertia::shareOnce('countries', fn () => Country::all())->until(now()->addDay());
111111
```
112112

113-
You may also define a dedicated `shareOnce()` method in your middleware. The middleware will evaluate both `share()` and `shareOnce()`, merging the results.
113+
Additionally, you may define a dedicated `shareOnce()` method in your middleware. The middleware will evaluate both `share()` and `shareOnce()`, merging the results.
114114

115115
```php
116116
class HandleInertiaRequests extends Middleware
@@ -126,7 +126,7 @@ class HandleInertiaRequests extends Middleware
126126

127127
## Prefetching
128128

129-
Once props work with [prefetching](/v2/data-props/prefetching). The client automatically includes any remembered once props in prefetched responses, so navigating to a prefetched page will already have the once props available.
129+
Once props are compatible with [prefetching](/v2/data-props/prefetching). The client automatically includes any remembered once props in prefetched responses, so navigating to a prefetched page will already have the once props available.
130130

131131
Prefetched pages containing an expired once prop will be invalidated from the cache.
132132

0 commit comments

Comments
 (0)