-
Notifications
You must be signed in to change notification settings - Fork 71
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
Use object instead of array for actions #66
Comments
The restriction for action field names to be unique, was introduced with the last merged pull request #64. It seems like an accident to me, as it forbids multiple values for an action field, as found in radio or checkbox inputs. |
@m0x72 I think we're talking about two difference things. I'm talking about the The snippet I gave above is in contrast to the snippet in the
|
Ah, I'm so sorry. I mixed them up. So yes, indeed a valid concern. It simplifies action lookup as well, but likely breaks any current implementations. Calls for a new major version? |
I also wondered why it is not an object? |
Actions are contained within an array where each array element is an object that must contain a
name
field that is unique to the array. Client behavior is undefined if two actions have the same name.This sounds exactly like a use case for using an object instead of an array, with the
name
field being the key for each action.An object eliminates the possibility of undefined behavior.
Why not use an object?
The text was updated successfully, but these errors were encountered: