medikoo / medikoo/observable-set

Simplify events handling

Open
#3 3 comments 0 reactions 1 assignee View on GitHub

@medikoo is already working on this.

Since Jan 15, 2016.

Dominant language
JavaScript
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Let's replace current events system with three kind of events:

  • add - when new element is added (separate event per element)
  • delete - when element is deleted (separate event per element)
  • change - whenever some change occurred in set.
    • It can be called once per many simultaneous changes, e.g. once per 2 adds and 3 deletes if they where done one after another.
    • It also can be called when in summary no elements where added and deleted, but ordering of elements in set have changed (e.g. when having { 1, 3 } set, we do set.clear(); set.add(3); set.add(1);. no add, and delete events will be invoked, however change event will occur.
    • It should also be allowed (for performance reasons) to emit change when change not necessarily may have occurred (and compute of whether it indeed occurred is expensive).
    • This event doesn't suppress add and delete, it's supplementary to first two

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.