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

It's likely that browser engine implementations would want to actually implement using index getters and setters against a custom backing store. It's better if spec concepts can map more closely to how things would be implemented (though of course not required, particularly if it hurts spec clarity). Is there a way to make this easy to use for spec authors without the dual hooks? I think the idea I suggested of passing a function to the hook that does the raw operation on the backing store would probably be not much harder for specs, and might make the algorithms more clear, since they would not be split into two parts.

One other thought: many Array operations end up doing quite a few insertions, deletions or updates as specified. It would be desirable to batch updates in such cases. Perhaps this would fall out naturally if any observables like this only really need to update at next microtask. But otherwise, the way Array operations are defined Maes this hard to do.



-- 
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-579387799

Received on Tuesday, 28 January 2020 18:25:12 UTC