Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Alex Lee alexlee85

🎯
Focusing
Block or report user

Report or block alexlee85

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View rxjs_operators_by_example.md
@alexlee85
alexlee85 / slick-dynamic-filter
Created Nov 17, 2014
Scala Slick dynamic filter
View 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
You can’t perform that action at this time.