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

Add development message provider #79

Merged
merged 2 commits into from
Mar 14, 2018
Merged

Add development message provider #79

merged 2 commits into from
Mar 14, 2018

Conversation

onbjerg
Copy link
Contributor

@onbjerg onbjerg commented Mar 14, 2018

This PR contains a small implementation of a message provider I use in my own sandbox to test the communication between apps and the wrapper.

It is used like so:

// Message bus used to pass messages between apps and the wrapper
const bus = new Subject()

// Set up app
const app = new App(
  new Messenger(new DevMessage('app', 'wrapper', bus))
)

// Run app
wrapper.runApp(
  new DevMessage('wrapper', 'app', bus),
  '0xbitconnect'
)

Where the first parameter is the provider's own ID, the second is its target ID and the third is an RxJS subject used to pass messages between the different providers.

@onbjerg onbjerg requested a review from sohkai March 14, 2018 15:29
@onbjerg onbjerg added enhancement New feature or request component: rpc labels Mar 14, 2018
Copy link
Contributor

@sohkai sohkai left a comment

Choose a reason for hiding this comment

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

👍

@@ -0,0 +1,21 @@
import Provider from './Provider'

export default class DevMessage extends Provider {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add the comments and example here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

@onbjerg onbjerg merged commit dda05ab into master Mar 14, 2018
@onbjerg onbjerg deleted the dev-message-provider branch March 14, 2018 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants