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.

Passing values shouldn't treat value property as value

See original GitHub issue
const fields = [
  'inventoryLevel.value',
];

const values = {
  inventoryLevel: {
    value: 2,
  },
};

const form = new Form({ fields, values });

console.log(form.$('inventoryLevel')); // Output: 2
console.log(form.$('inventoryLevel.value')); // Error

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
foxhound87commented, Dec 29, 2016

Should work now.

I made more tests and I think I will not remove the unified properties anymore. The code is deeply glued to both styles and would be a pain to rewrite all.

1reaction
foxhound87commented, Dec 3, 2016

Using the $ as prop prefix will fix this issue, but I think we should deprecate the unified properties on the long term, if we remove them the code will be better (no more confusion on syntax to use and the build will be smaller). Using the separated properties is more flexible I think. I’m also having other issues on managing the state of the unified properties, additional code should be added to fix nested fields props when are updated, and it seems a bit tricky.

Read more comments on GitHub >

github_iconTop Results From Across the Web

pass by value - Is it a good practice to change arguments in Java
It's considered bad practice in general, though some people overlook it as you can see in the other answers. For parameters like primitives...
Read more >
Pass-by-value, reference, and assignment | Pydon't - Mathspp
This article explains why Python doesn't use a pass-by-value system, nor a pass-by-reference.
Read more >
4. Methods Use Instance Variables: How Objects Behave
A method can have parameters, which means you can pass one or more values in to the method. The number and type of...
Read more >
Objects - The Modern JavaScript Tutorial
A property is a “key: value” pair, where key is a string (also called a “property name”), and value can be anything. We...
Read more >
Properties — The Swift Programming Language (Swift 5.7)
Properties associate values with a particular class, structure, or enumeration. Stored properties store constant and variable values as part of an instance, ...
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