Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Migrate to DI #32

Merged
merged 8 commits into from
Jan 12, 2018
Merged

Migrate to DI #32

merged 8 commits into from
Jan 12, 2018

Conversation

ganemone
Copy link
Contributor

Fixes #30

@old-fusion-bot
Copy link

Found TODOs without GitHub issues:

// TODO: refactor to post to server

@codecov
Copy link

codecov bot commented Jan 12, 2018

Codecov Report

Merging #32 into master will increase coverage by 1.09%.
The diff coverage is 88%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #32      +/-   ##
=========================================
+ Coverage    86.4%   87.5%   +1.09%     
=========================================
  Files           3       4       +1     
  Lines         103     112       +9     
  Branches       19      16       -3     
=========================================
+ Hits           89      98       +9     
- Misses          6       7       +1     
+ Partials        8       7       -1
Impacted Files Coverage Δ
src/index.js 100% <100%> (ø)
src/server.js 87.5% <86.66%> (+1.13%) ⬆️
src/browser.js 89.65% <89.65%> (+1.19%) ⬆️

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 f2e3fbd...2cbad1f. Read the comment docs.

README.md Outdated
@@ -1,4 +1,4 @@
# fusion-plugin-universal-events
# fusion-plugin-universal-events
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove leading spaces

const scoped = events.from(ctx);
```

Returns a scoped version of the events api.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain why one would want to use this over the global instance. Document API differences between a global emitter and a scoped one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be explained in the "Accessing ctx section

README.md Outdated

Returns a scoped version of the events api.

- `ctx: FusionContext` - Required.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should link to docs about FusionContext

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are we planning on doing those links when we have to handle both open source and closed source documentation?

return new ScopedEmitter(ctx, this);
});
}
emit(type, payload, ctx) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Under what use cases would one use the 3rd arg here, and under what use cases would one use emitter.from? Is there a strong enough motivation to have both be part of the API?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is purely implementation detail, and not exposed

README.md Outdated
@@ -1,4 +1,4 @@
# fusion-plugin-universal-events
# fusion-plugin-universal-events

[![Build status](https://badge.buildkite.com/de4e30ddb9d019f5a8e3a2519bc0a5cccab25247809cd10c99.svg?branch=master)](https://buildkite.com/uberopensource/fusion-plugin-universal-events)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be a section talking about why we didn't use an existing event emitter library and how the API and semantics of our library differs from other event emitters.

If this library is not a suitable implementation for a hypothetical EventEmitterToken interface, we should also mention that.

@ganemone
Copy link
Contributor Author

!merge

@old-fusion-bot old-fusion-bot bot merged commit 95b2fcd into fusionjs:master Jan 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants