4

Is it possible to use Lift's CSS Selector Transforms together with DispatchSnippet? It does not seem to work for me.

1 Answer 1

4

Answering my own question... yeah, it is possible! My problem was the following: Snippet methods have to be of the type NodeSeq => NodeSeq but CSS Transformations return a () => CSSSel. A CSSSel is itself NodeSeq => NodeSeq, so the CSS Transformation is () => (NodeSeq => NodeSeq).

That means, in order to use it with DispatchSnippet it must be referenced like this in the dispatcher:

def dispatch: DispatchIt = {
  case "method1" => normalSnippetMethod _
  case "method2" => cssTransform // no _ !
}

Basically, I just had an extra _ sign at the end.

Sign up to request clarification or add additional context in comments.

1 Comment

Css transformations are not () => NodeSeq => NodeSeq. Can you show more of your code?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.