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

error TS2339: Property 'emit' does not exist on type 'MyClass2'. #26

Open
khusamov opened this issue May 11, 2017 · 1 comment
Open

Comments

@khusamov
Copy link

Hello!

The following code does not work. How do I fix this error?

import * as EventEmitter from 'events';

let MyMixin = Mixin((superclass) => class extends superclass {

  foo() {
    console.log('foo from MyMixin');
    super.foo();
  }

});

class MyClass extends mix(EventEmitter).with(MyMixin) {

  foo() {
    console.log('foo from MyClass');
    super.foo(); 
  }

}


class MyClass2 extends MyClass {
    
    method1() {
        this.emit('event1'); // error TS2339: Property 'emit' does not exist on type 'MyClass2'.
    }
    
}
@Gharaibeh
Copy link

const io = require('socket.io')(server);
this.io.emit('data', { data: value });

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

2 participants