We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
TypeScript Version: Version 3.5.3
Search Terms:
Class property initialization, error TS2564: Property has no initializer and is not definitely assigned in the constructor.
Code
export class NetworkConnection extends EventEmitter { private intervalId: NodeJS.Timeout; public constructor(timeout = 60000) { super(); this.start(timeout); } public start = (timeout: number) => { this.intervalId = setInterval(this.broadcast, timeout); }; public stop = () => { clearInterval(this.intervalId); }; ... }
Expected behavior:
Run without compile error.
Actual behavior:
error TS2564: Property 'intervalId' has no initializer and is not definitely assigned in the constructor.
Playground Link:
Related Issues: #24446 #21132
The text was updated successfully, but these errors were encountered:
Duplicate of #21132, not just a related issue. And #30462 is an open proposal regarding this.
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
TypeScript Version: Version 3.5.3
Search Terms:
Class property initialization, error TS2564: Property has no initializer and is not definitely assigned in the constructor.
Code
Expected behavior:
Run without compile error.
Actual behavior:
error TS2564: Property 'intervalId' has no initializer and is not definitely assigned in the constructor.
Playground Link:
Related Issues: #24446 #21132
The text was updated successfully, but these errors were encountered: