I read a code of finch
-library, and I see such examples
get("todos") {
storeRef.get.map(m => Ok(m.values.toList.sortBy(-_.id)))
}
or
delete("todos" :: path[Int]) { id: Int => ... }
I checked out these methods in my IDE, and these methods create a few objects underhood (Mappable
), but I still do not understand how it's possible. Because signatures of these methods do not contain any function as a parameter and moreover how they understand when param is Int or String or something else?