Search code examples
partial-applicationlivescript

How to pass arguments automatically in LiveScript


How I can simplify line 3 (onChange property):

Input do
  name: \input
  onChange: (event, value) ~> @limitInput { type: \string }, event, value

Solution

  • You can use a bound partial application, documented here. Example:

    Input do
      name: \input
      onChange: @~limitInput({type: \string}, _, _)