Skip to content

Commit

Permalink
README.md update
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Sarvarov committed Jun 12, 2024
1 parent 06fb643 commit 26c1fa9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ i, err := inertia.New(
```go
props := inertia.Props{
"regular": "prop",
"closure": func () (any, error) { return "prop", nil },
"closure": func () (any) { return "prop" },
"closure_with_err": func () (any, error) { return "prop", nil },
"lazy": inertia.LazyProp(func () (any, error) {
return "prop", nil
},
Expand Down
2 changes: 1 addition & 1 deletion props.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (i *Inertia) propsKeysToReturn(r *http.Request, component string) map[strin
func resolvePropVal(val any) (_ any, err error) {
switch typed := val.(type) {
case func() any:
return typed, nil
return typed(), nil
case AlwaysProp:
return typed(), nil
case func() (any, error):
Expand Down

0 comments on commit 26c1fa9

Please sign in to comment.