Skip to content

Commit

Permalink
docs: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Nov 14, 2022
1 parent 3ce4dbe commit c8c3e36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/pages/getContext.page.server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Link, CodeBlock } from '@brillout/docpress'

**Environment**: Server.

The `getContext()` function enables telefunctions to access contextual information.
`getContext()` enables telefunctions to access contextual information.

```js
// TodoList.telefunc.ts
Expand All @@ -11,7 +11,6 @@ The `getContext()` function enables telefunctions to access contextual informati
import { getContext } from 'telefunc'

export async function onLoad() {
// A commmon use case is to provide information about the logged-in user:
const context = getContext()
const { user } = context
const todoItems = await Todo.findMany({ select: 'text', authorId: user.id })
Expand All @@ -22,6 +21,8 @@ export async function onLoad() {
}
```

It's most commonly used for implementing permissions, see <Link href="/permissions" />.


## Provide

Expand Down

0 comments on commit c8c3e36

Please sign in to comment.