Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented passing of context as final argument to helpers #99

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/0.3-gumbo/reference.md
Expand Up @@ -118,6 +118,11 @@ Since the parameter is actually an object, you can define any number of helpers
@sum: (a, b) -> a + b @sum: (a, b) -> a + b
@subtract: (a, b) -> a - b @subtract: (a, b) -> a - b


Finally, the request/event context is always passed as a final argument to the helper, allowing fat-arrow helpers:

@usefulThing
@helper thanks: (msg, ctx) => @usefulThing.thank(ctx.request.user, msg)

### @view ### @view


`@view path: contents` `@view path: contents`
Expand Down