grpc / grpc/grpc-web

StreamInterceptor type doesn't support Promise intercept

Open
#988 9 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
802
Avg merge
1d 7h
Merged PRs (30d)
5

Description

The following won't compile but should/does work:

```ts
import {
StreamInterceptor,
} from 'grpc-web';

const streamAuthInterceptor: StreamInterceptor = {
async intercept(request, invoker) {
await authRequest(request);
return invoker(request);
},
};
```

removing the `StreamInterceptor` type from the variable lets it compile and it behaves as expected (adding the appropriate metadata to the request)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.