Make `opts` arg optional for `sub` method
In the README and the code, it looks like the second argument for the relay's `sub` method is optional:
```typescript
let sub = relay.sub([
{
ids: ['d7dd5eb3ab747e16f8d0212d53032ea2a7cadef53837e5a6c66d42849fcb9027']
}
])
```
In the type definitions it's required however, which leads to an error in editors. Let's mark it as optional in the type definitions too! 👍
This commit is contained in:
parent
cc2250da1f
commit
8071e2f4fa
2
relay.ts
2
relay.ts
|
@ -10,7 +10,7 @@ export type Relay = {
|
|||
status: number
|
||||
connect: () => Promise<void>
|
||||
close: () => Promise<void>
|
||||
sub: (filters: Filter[], opts: SubscriptionOptions) => Sub
|
||||
sub: (filters: Filter[], opts?: SubscriptionOptions) => Sub
|
||||
publish: (event: Event) => Pub
|
||||
on: (type: RelayEvent, cb: any) => void
|
||||
off: (type: RelayEvent, cb: any) => void
|
||||
|
|
Loading…
Reference in New Issue