Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
petaki authored Oct 18, 2020
1 parent e1367a6 commit b99d5b4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mux.Handle("/", inertiaManager.Middleware(homeHandler))
func homeHandler(w http.ResponseWriter, r *http.Request) {
// ...

err := app.inertiaManager.Render(w, r, "home/Index", nil)
err := inertiaManager.Render(w, r, "home/Index", nil)
if err != nil {
// Handler server error...
}
Expand All @@ -47,7 +47,7 @@ Or render with props:
```go
// ...

err := app.inertiaManager.Render(w, r, "home/Index", map[string]interface{}{
err := inertiaManager.Render(w, r, "home/Index", map[string]interface{}{
"total": 32,
})

Expand Down Expand Up @@ -81,7 +81,7 @@ func authenticate(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// ...

ctx = app.inertiaManager.WithProp(r.Context(), "authUserId", user.Id)
ctx := inertiaManager.WithProp(r.Context(), "authUserId", user.Id)
next.ServeHTTP(w, r.WithContext(ctx))
})
}
Expand All @@ -90,7 +90,7 @@ func authenticate(next http.Handler) http.Handler {
### Share data with root template

```go
ctx = app.inertiaManager.WithViewData(r.Context(), "meta", meta)
ctx := inertiaManager.WithViewData(r.Context(), "meta", meta)
r = r.WithContext(ctx)
```

Expand Down

0 comments on commit b99d5b4

Please sign in to comment.