Clarify the remark about the Pointer<O> type

https://github.com/theatre-js/theatre/pull/118#discussion_r846628315
This commit is contained in:
Aria Minaei 2022-04-09 17:09:51 +02:00
parent bd8999f0f2
commit 72ada325be

View file

@ -41,7 +41,7 @@ export type PointerType<O> = {
* ```ts * ```ts
* declare function expectAnyPointer(pointer: Pointer<any>): void * declare function expectAnyPointer(pointer: Pointer<any>): void
* *
* expectAnyPointer(null as Pointer<{}>) // doesn't work * expectAnyPointer(null as Pointer<{}>) // this shows as a type error because Pointer<{}> is not assignable to Pointer<any>, even though it should
* ``` * ```
* *
* The current solution is to just avoid using `any` with pointer-related code (or type-test it well). * The current solution is to just avoid using `any` with pointer-related code (or type-test it well).