# Function: watchGrant()

```ts
function watchGrant(
   node, 
   grant, 
   on
): () => void;
```

Defined in: [packages/core/src/session/connect.ts:601](https://github.com/leifriksheim/minca/blob/main/core/src/session/connect.ts#L601)

Watches a node started under a grant: `onExpired` once its note runs out,
`onRevoked` for each space where the home revoked its key.

## Parameters

| Parameter | Type |
| ------ | ------ |
| `node` | `Pick`\<[`P2PNode`](https://minca.dev/api/core/interfaces/P2PNode.md), `"subscribe"`\> |
| `grant` | `Pick`\<[`Grant`](https://minca.dev/api/session/interfaces/Grant.md), `"expiresAt"`\> |
| `on` | \{ `onExpired?`: () => `void`; `onRevoked?`: (`space`) => `void`; \} |
| `on.onExpired?` | () => `void` |
| `on.onRevoked?` | (`space`) => `void` |

## Returns

How to stop watching

() => `void`
