Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lambda in staticCommand can not pass arguments to server methods #980

Closed
exyi opened this issue Mar 19, 2021 · 2 comments · Fixed by #1170
Closed

lambda in staticCommand can not pass arguments to server methods #980

exyi opened this issue Mar 19, 2021 · 2 comments · Fixed by #1170
Assignees
Labels
Milestone

Comments

@exyi
Copy link
Member

exyi commented Mar 19, 2021

{staticCommand: (int x) => s.Method(x)} produces invalid expression - the argument is declared after the Method is invoked, which leads to JS error.

@tomasherceg
Copy link
Member

We need to do this change in DotVVM 4.0 because it depends on dropping the support for IE11 (we need to use async/await in JS expressions).

@quigamdev
Copy link
Contributor

quigamdev commented Aug 28, 2021

Since we have rewritten promises to async/await calls, we should add tests for this case. (referring to #1105)

@exyi exyi self-assigned this Oct 13, 2021
exyi added a commit that referenced this issue Oct 14, 2021
The parameters were passed in a very weird way, now it works similar
to command bindings - even when command is not a lambda function, it is
wrapped in a lambda function. Then, the lambda function gets parameters
assigned directly, so the lambda syntax is essentially eliminated.
This back and forth is kinda needed to align how it works in case command
is specified as plain expression and when it's specified as
lambda function.

resolves  #980, #1165
exyi added a commit that referenced this issue Oct 16, 2021
The parameters were passed in a very weird way, now it works similar
to command bindings - even when command is not a lambda function, it is
wrapped in a lambda function. Then, the lambda function gets parameters
assigned directly, so the lambda syntax is essentially eliminated.
This back and forth is kinda needed to align how it works in case command
is specified as plain expression and when it's specified as
lambda function.

resolves  #980, #1165
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants