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

Pseudo-code for RCEvent+RCEventControler #8

Merged
merged 8 commits into from
Nov 28, 2017

Conversation

alexstrat
Copy link
Contributor

@alexstrat alexstrat commented Nov 28, 2017

Usage:

// renderer
chrome.webRequest.onBeforeRequest = new RCEvent(`${extensionId}-webRequest.onBeforeRequest`)

// main
const eventControler = new new RCEventControler(`${extensionId}-webRequest.onBeforeRequest`)
eventControler.on('new-listener', (listenerArgs, remoteCallListener) => {
  const filter = listenerArgs[0]
  electron.webRequest.onBeforeRequest(filter, (details, callback) => {
    remoteCallListener(details).then(cbReturn => callback(cbReturn));
  })
})

@alexstrat alexstrat mentioned this pull request Nov 28, 2017
6 tasks
controler.on('new-listener', (listenerArgs, remoteCallListener) => {
const filter = listenerArgs[0];
this.electronWebRequestApi[methodName](filter, (details, callback) => {
console.log(details);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove

@hugomano hugomano merged commit adf9472 into fix/mixmax Nov 28, 2017
@hugomano hugomano deleted the fi/mixmax/abstract-rc-event branch November 30, 2018 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants