This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// QUERIES | |
// Get all nodes | |
MATCH(n) | |
RETURN n | |
// Get all nodes with label | |
MATCH(m:Movie) | |
RETURN m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Defers an execution until a promise is awaited */ | |
class DeferredPromise<T = void> extends Promise<T> { | |
private executor: () => Promise<T>; | |
private resultPromise: Promise<T> | undefined; // Memoize the promise, to avoid executing the executor twice if awaited twice | |
constructor(executor: () => Promise<T>) { | |
super(() => { | |
// Dummy callback to make Promise happy | |
}); | |
this.executor = executor; |
OlderNewer