io.frontroute.DirectiveApplyConverters.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of frontroute_sjs1_3.0.0-RC1 Show documentation
Show all versions of frontroute_sjs1_3.0.0-RC1 Show documentation
Router library based for Laminar with DSL inspired by Akka HTTP.
The newest version!
package io.frontroute
import app.tulz.tuplez._
import Types.Route
trait DirectiveApplyConverters extends ApplyConverters[Route] {
implicit def addDirectiveApply[L](directive: Directive[L])(implicit hac: ApplyConverter[L, Route]): hac.In => Route =
subRoute =>
(ctx, previous, state) => {
val result = directive.tapply(hac(subRoute))(ctx, previous, state)
result
}
implicit def addNullaryDirectiveApply(directive: Directive0): Route => Route =
subRoute =>
(ctx, previous, state) => {
val result = directive.tapply(_ => subRoute)(ctx, previous, state)
result
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy