Last active
August 16, 2019 17:48
-
-
Save FlavienBusseuil/f39fc59d46f72a0e80ab2f5f8eda278c to your computer and use it in GitHub Desktop.
Inline Conditional Initialization with F# Pipeline Operator
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
const filters = { filter1, filter2 } | |
|> f => condition ? { ...f, filter3 } : f | |
|> f => { ...f, filter4 }; | |
db.collection.find(filters); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment