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

{{sub}} seems to accept array instead of N arguments #1623

Open
MichalBryxi opened this issue Jun 20, 2024 · 4 comments
Open

{{sub}} seems to accept array instead of N arguments #1623

MichalBryxi opened this issue Jun 20, 2024 · 4 comments

Comments

@MichalBryxi
Copy link

MichalBryxi commented Jun 20, 2024

The documentation says:

{{sub a b}}

But if I try that I will get:

Screenshot 2024-06-20 at 13 11 22

Moreover the documentation also defines sub as:

sub(numbers: number[]): number

Which seems to align with the idea of passing down an array? So the example code should be:

{{sub (array a b)}}

That being said, I find that a bit weird API and would hope for {{sub a b}} to simply work.

Applies for:

    "ember-math-helpers": "^4.0.0",
@RobbieTheWagner
Copy link
Owner

@MichalBryxi seems like maybe just the types are wrong?

@MichalBryxi
Copy link
Author

MichalBryxi commented Jun 26, 2024

@MichalBryxi seems like maybe just the types are wrong?

@RobbieTheWagner I'm not sure what that means? Should I update some package? The types are afaik number as per the example: {{sub 2 1}}.

@RobbieTheWagner
Copy link
Owner

@MichalBryxi I am saying the types are likely wrong. The helper has not changed and works as documented, but TS/glint is what you seem to be running into issues with. I myself have not experienced the same issue, but that is likely where the issue lies.

@RobbieTheWagner
Copy link
Owner

Are you importing the registry and adding it to your local glint registry? It seems to be working fine for me.

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

No branches or pull requests

2 participants