* Wraps an equality function to handle either value being `undefined`.
(equal: ValueEqualityFn<T>)
| 575 | * Wraps an equality function to handle either value being `undefined`. |
| 576 | */ |
| 577 | function wrapEqualityFn<T>(equal: ValueEqualityFn<T>): ValueEqualityFn<T | undefined> { |
| 578 | return (a, b) => (a === undefined || b === undefined ? a === b : equal(a, b)); |
| 579 | } |
| 580 | |
| 581 | function createLoader<T, R>( |
| 582 | options: PromiseResourceOptions<T, R> & {debugName?: string}, |