This file contains 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
// This file contains common operations that will need to be performed often. | |
import { firestore } from "firebase"; | |
import { isUndefined } from "util"; | |
/** | |
* This function takes a collection reference and turns it into an array | |
* of its constituent document references | |
* | |
* @param coll the collection to convert into a docref array |
This file contains 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
// ------------------------------------------------------------------------------------------------------------------------------------- | |
// This is a basic example of how a framework can be developed to apply a series of transformations in sequence. | |
// ------------------------------------------------------------------------------------------------------------------------------------- | |
type Chain<T> = { | |
value: T, | |
apply: (transform: (value: T) => T) => Chain<T>, | |
} | |
function wrap<T>(value: T): Chain<T> { |