Closed sethladd closed 9 years ago
I believe this is against the lambda specs. Lambdas' arity is either zero or one.
Do you have a real world example for that? Have in mind that as you are in charge of the given lambda, you can make use of whatever context you feel like within it. Why would you like the library to provide you with one?
For use case, see https://github.com/valotas/mustache4dart/issues/39
Because my lambda is in a loop, I have no idea which item I'm currently looping over. I need that context passed to me.
No need for merge as the issue has been fixed with 0b2e12665f071636baea2ed14fc113f97f7f0769. It still uses most of your code. Thanks
No problem. Thanks!
Addresses https://github.com/valotas/mustache4dart/issues/39
All tests are passing on my machine.
NOTE: this is a breaking change. Lambdas now expect two params: the string and the context. Consider bumping version to 1.1.
If you want to support one or two parameter lambdas, you can do it.
And then in your lambda calling logic:
I did not do this, as I'm not sure if you care.
BTW is context always a
MustacheContext
? I wasn't sure, so I left it dynamic.