Re: [heycam/webidl] Introduce the observable array type (#836)

Strong agree that we need at least a 4-hook model. 2 hooks are unsound; there's nothing theoretically preventing an ObservableArray from allowing `undefined` in its type signature, and so an `undefined` can come in via an explicit set.  Plus, as shown by your examples in the spec, hooks will generally just immediately branch on whether the value is undefined or not; it's clearer both to read and write if these were separated from the start.

1 hook is sound, but annoying; most of the time I'll just be validating the one value being set, and having to specify that as iterating the list and revalidating everything would be both annoying and less clear in my intent.

I don't have an opinion on which of the 4/6 hook options to go for, but I lean *slightly* toward update/delete pair.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/pull/836#issuecomment-578590562

Received on Monday, 27 January 2020 04:50:18 UTC