StreamInterceptor type doesn't support Promise intercept
Open
- 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
Assessment
This issue has not been assessed yet.