All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.frontroute.DirectiveApplyConverters.scala Maven / Gradle / Ivy

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