Upgrade typescript
This commit is contained in:
parent
cb6693413f
commit
cfb324a6d5
24 changed files with 57 additions and 41 deletions
|
@ -696,7 +696,7 @@ describe(`The exhaustive guide to dataverse`, () => {
|
|||
|
||||
// Let's create a function that will set a property of an object by a pointer, similar to `lodash.set()`.
|
||||
// The function will take the root object, the pointer, and the new value.
|
||||
function setByPointer<Root, Value>(
|
||||
function setByPointer<Root extends {}, Value>(
|
||||
root: Root,
|
||||
getPointer: (ptr: Pointer<Root>) => Pointer<Value>,
|
||||
newValue: Value,
|
||||
|
|
|
@ -233,7 +233,7 @@ class PrismInstance<V> implements Prism<V> {
|
|||
}
|
||||
|
||||
// let's cache the last value so we don't call the listener if the value hasn't changed
|
||||
let lastValue =
|
||||
let lastValue: V | typeof emptyObject =
|
||||
// use an empty object as the initial value so that the listener is called on the first tick.
|
||||
// if we were to use, say, undefined, and this.getValue() also returned undefined, the listener
|
||||
// would never be called.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue