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

MessageChannel #92

Open
calvinmetcalf opened this issue Jul 18, 2013 · 1 comment
Open

MessageChannel #92

calvinmetcalf opened this issue Jul 18, 2013 · 1 comment

Comments

@calvinmetcalf
Copy link
Owner

var p2;
var port = cw(function(data,cb){
    this.x = new MessageChannel();
    this.on('mess',function(a){
        this.x.port1.postMessage(a);
    });
    cb(this.x.port2,[this.x.port2]);
});

port.data(1).then(function(a){
    console.log('yes');
    p2=a;
},function(a){
    console.log(a);
});

p2.onmessage=function(a){
    console.log('msg ',a.data);
}

port.fire('mess','hello there')

this could be a polyfill for sub workers in chrome

@calvinmetcalf
Copy link
Owner Author

taking this off of 2.0.0

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

No branches or pull requests

1 participant