Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Sarvarov committed Oct 12, 2024
1 parent 138815b commit b40fce0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ ctx := inertia.SetEncryptHistory(r.Context())

Clear history:
```go
ctx := inertia.SetClearHistory(r.Context())
ctx := inertia.ClearHistory(r.Context())

// pass it to the next middleware or inertia.Render function using r.WithContext(ctx).
```
Expand Down
4 changes: 2 additions & 2 deletions context.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func EncryptHistoryFromContext(ctx context.Context) (bool, bool) {
return encryptHistory, ok
}

// SetClearHistory cleaning history state.
func SetClearHistory(ctx context.Context) context.Context {
// ClearHistory cleaning history state.
func ClearHistory(ctx context.Context) context.Context {
return context.WithValue(ctx, clearHistoryContextKey, true)
}

Expand Down
4 changes: 2 additions & 2 deletions context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,10 @@ func Test_EncryptHistoryFromContext(t *testing.T) {
}
}

func TestInertia_SetClearHistory(t *testing.T) {
func TestInertia_ClearHistory(t *testing.T) {
t.Parallel()

ctx := SetClearHistory(context.Background())
ctx := ClearHistory(context.Background())

got, ok := ctx.Value(clearHistoryContextKey).(bool)
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion response.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type TemplateFuncs map[string]any
// and will be available in the front-end component.
type Props map[string]any

// OptionalProp is a property that will evaluate then needed.
// OptionalProp is a property that will evaluate when needed.
//
// https://inertiajs.com/partial-reloads
type OptionalProp struct {
Expand Down
2 changes: 1 addition & 1 deletion response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func TestInertia_Render(t *testing.T) {

ctx := r.Context()
ctx = SetEncryptHistory(ctx, true)
ctx = SetClearHistory(ctx)
ctx = ClearHistory(ctx)

err := I().Render(w, r.WithContext(ctx), "Some/Component")
if err != nil {
Expand Down

0 comments on commit b40fce0

Please sign in to comment.