Skip to content
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

Harmonize event emitters implementation #210

Merged
merged 13 commits into from
May 8, 2017
Merged

Conversation

ballinette
Copy link

main Kuzzle SDK prototype and websocket wrapper implementation both used their own event listeners.

Now, both Kuzzle and websocket wrapper inherits from Node build-in EventEmitter class (https://nodejs.org/api/events.html), with a polyfilled implementation for browser.

Breaking Changes

method addListener no longer returns an ID, to be compliant with NodeJS implementation ( https://nodejs.org/api/events.html#events_emitter_on_eventname_listener )
It now returns the Emitter object itself, so that it can be chained.

For each event, the listener callback function is used as the key in listeners list

Documentation

kuzzleio/documentation#172

@codecov-io
Copy link

codecov-io commented May 8, 2017

Codecov Report

Merging #210 into 5.x will decrease coverage by 4.29%.
The diff coverage is 34.64%.

Impacted file tree graph

@@            Coverage Diff            @@
##              5.x     #210     +/-   ##
=========================================
- Coverage   99.36%   95.06%   -4.3%     
=========================================
  Files          16       17      +1     
  Lines        1733     1885    +152     
  Branches      465      511     +46     
=========================================
+ Hits         1722     1792     +70     
- Misses         11       93     +82
Impacted Files Coverage Δ
src/Kuzzle.js 99.62% <100%> (+0.16%) ⬆️
src/networkWrapper/wrappers/websocket.js 100% <100%> (ø) ⬆️
src/eventEmitter/index.js 12.63% <12.63%> (ø)
src/Document.js 100% <0%> (ø) ⬆️
src/security/Security.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 332b4b1...8a77b58. Read the comment docs.

@ballinette
Copy link
Author

See discussion on #197 that were approved, but merged on the wrong branch

@ballinette ballinette merged commit 149042a into 5.x May 8, 2017
@ballinette ballinette deleted the refactor-event-emitters branch May 8, 2017 22:29
This was referenced May 24, 2017
@scottinet scottinet mentioned this pull request Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants