GoogleChromeLabs / GoogleChromeLabs/comlink

Typescript RemoteObject does not allow assignment of non-promise value

Open
#483 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
12.8k
Forks
435
PR merge metrics
No merged PRs in 30d

Description

The following code does not appear to compile using `comlink@4.3.0`
```typescript
type RA = Remote<{foo:string}>
declare const a: RA
a.foo = "bar"
```
On account of `a.foo` being a `Promise` and `"bar"` being a `string`. I understand there's currently [no way to allow separate setter and getter types](https://github.com/microsoft/TypeScript/issues/2521), but it seemed like the code worked differently before moving to `4.3.0`?

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.