question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[state] Does not allow declarative comparisons of numerical state values

See original GitHub issue

Hi, Kevin.

I’m currently using/testing in the latest 4.7.0 version, and it appears that it is not possible to make declarative comparisons against numerical state values.

Example: <a-entity ... bind__visible="level === 4"></a-entity>

If the state value is stored a string ("4"), then it works, but that requires manually parsing to and from string/number if it’s necessary to manipulate the number.

I wasn’t sure if this was by design, so I just thought I’d mention it.

I’m not sure if it would be possible to also add the ability to make <, >, <=, >=, <==, >== comparisons declaratively, but would be a cool feature. Let me know if that’s something I should open an enhancement request for.

Thanks for a great component.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ngokevincommented, Sep 11, 2018

It’s not that it’s recommended over aframe-react persay, it’s that React and friends are very poor tools for VR and I’ve seen it cause more distraction and trouble than help.

Can create a component that takes the points and threshold and handles appropriately.

0reactions
ngokevincommented, Oct 12, 2018

Pretty much that code will get evaled, so yeah.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Amazon States Language
Amazon States Language. This document describes a JSON-based language used to describe state machines declaratively. The state machines thus defined may be ...
Read more >
Sync Options - Argo CD - Declarative GitOps CD for Kubernetes
Argo CD allows users to customize some aspects of how it syncs the desired state in the target cluster. Some Sync Options can...
Read more >
Declarative SQL: Using CHECK() & DEFAULT - Simple Talk
SQL is unusual is that data is not passively stored. ... as minimums and/or maximums for numeric values or allowed values for a...
Read more >
Difference between declarative and imperative in React.js?
A declarative style, like what react has, allows you to control flow and state in your application by saying "It should look like...
Read more >
Content filtering in Amazon EventBridge event patterns
Amazon EventBridge supports declarative content filtering using event patterns. With content filtering, you can write complex event patterns that only match ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found