-
Notifications
You must be signed in to change notification settings - Fork 49
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
Add advice about read-only lists #292
Conversation
The added recommendation is about the types of static lists to be considered for API design. Addresses #50
What happened to ReadOnlyArray? Was it folded into ObservableArray as a special case? |
@plinss and I discussed this in a breakout during the F2F. We think the ObservableArray recommendation is a bit strange - the observable properties are definitely not desirable by every case where an attribute is needed, and there are cases where read-only is desirable (e.g. in an attribute) - but this PR doesn't seem to cover that. Also, @plinss mentioned he wasn't so sure about the return being restricted to only sequences. There are cases where other array types are more desirable, but this feels a bit restrictive. |
@LeaVerou I'm not aware of a @domenic was it considered to have default implementations of delete and set an indexed value so that the readonly case would be consistent across APIs? That does strike me as something that is missing, but I might also be missing something. 😊 |
The plan was to create a ReadonlyArray Web IDL type which has those defaults and uses the same underlying infrastructure as ObservableArray. |
Ah okay, so I guess we're mainly waiting for a consumer of that. Thanks! |
* Add advice about read-only lists The added recommendation is about the types of static lists to be considered for API design. Addresses #50 * Addressing CR feedback * One last nit addressed
The added recommendation is about the types of static lists to be considered for API design.
Addresses #50
Preview | Diff