ObservableWithProperty
typedef
A helper type that can be used as a constraint, ensuring the type is both observable and have the given property.
// Ensures that `obj` is `Observable` and have property named 'abc'.
function f<O extends ObservableWithProperty<'abc'>>( obj: O ) {}
// Ensures that `obj` is `Observable` and have property named 'abc' with value `number`.
function f<O extends ObservableWithProperty<'abc', number>>( obj: O ) {}
Type parameters
-
TKey : extends PropertyKey
-
TVal : any