Skip to content

Instantly share code, notes, and snippets.

View alexlee85's full-sized avatar
🎯
Focusing

Alex Lee alexlee85

🎯
Focusing
View GitHub Profile
@alexlee85
alexlee85 / rxjs_operators_by_example.md
Created November 28, 2017 02:27 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@alexlee85
alexlee85 / slick-dynamic-filter
Created November 17, 2014 04:57
Scala Slick dynamic filter
implicit class QueryHelper[T, E](query: Query[T, E, Seq]) {
def optionFilter[X, R: CanBeQueryCondition](name: Option[X])(f: (T, X) => R) =
name.map(v => query.withFilter(f(_, v))).getOrElse(query)
}
query.optionFilter(name)(_.name === _)
.optionFilter(email)(_.email === _).list