Fix IReactionDisposer and IIsObservableObject Typing
This is typing only PR.
Current interface definition for IReactionDisposer is
export interface IReactionDisposer {
(): void
$mobx: Reaction
}
but that's wrong because because like so typescript considers the property key $mobx to be a string, whereas it is a symbol. The correct indexing type is given by
export interface IReactionDisposer {
(): void
[$mobx]: Reaction
}
[Edit] : same thing for IIsObservableObject
🦋 Changeset detected
Latest commit: da624fb514aa1151669ac0b849a89c75daa96e44
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| mobx | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@barroij Thank you. Do you think it makes sense to update IIsObservableObject as well?
https://github.com/mobxjs/mobx/blob/13a222ea21bd55b7158d48a998846da608080ded/packages/mobx/src/types/observableobject.ts#L650
@kubk You are right, I'm gonna change it too.
Note : fixing typing for IIsObservableObject resulted in a test failure (packages/mobx/src/api/tojs.ts:57:28 - error TS2339: Property 'forEach' does not exist on type 'ArrayLike<string | symbol>'.).
I had to change the return type of function ObservableObjectAdministration.ownKeys_ from ArrayLike<string | symbol> to Array<string | symbol> to fix it