medikoo / medikoo/observable-array
Simplify events handling
@medikoo is already working on this.
Since Jan 15, 2016.
- Dominant language
- JavaScript
- Stars
- 8
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Let's replace current events system with three kind of events (similar to set handling)
add- when new value is added (separate event per each added value)delete- when value is deleted (separate event per each value pair)change- whenever some change occurred in array- It can be called once per many simultaneous changes,
- It also can be called when in summary no changes to what values are contained has been made, but order of values in array have changed.
- It should also be allowed (for performance reasons) to emit
changewhen change not necessarily may have occurred (and compute of whether it indeed occurred is expensive). - This event doesn't suppress
addanddelete, it's supplementary to first two.
Array is technically a map (index/value pairs), so it may feel more appropriate to use map-like events system (set & delete). However this can be expensive and not that needed. Imagine we shift element from large array. All index/value mappings in array have changed, so in such case we would have to emit set events for each value. While for most cases two events delete and change will provide all we need.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.