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

Lazy state: doesn't work in non-operation function arguments #745

Open
josephjclark opened this issue Aug 14, 2024 · 0 comments
Open

Lazy state: doesn't work in non-operation function arguments #745

josephjclark opened this issue Aug 14, 2024 · 0 comments

Comments

@josephjclark
Copy link
Collaborator

josephjclark commented Aug 14, 2024

This:

fnIf(
  Object.values($.results).length === 0
  state => console.log(`Couldn't find records for '*:${state.cursor}*'`)
}

Compiles to this:

fnIf(Object.values(state => state.results).length === 0, state =>
  console.log(`Couldn't find records for '*:${state.cursor}*'`)
)];

Which is wrong. We needed to walk a bit higher up the try to work out where to put the wrapping function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New Issues
Development

No branches or pull requests

1 participant