TypeScript-Handbook icon indicating copy to clipboard operation
TypeScript-Handbook copied to clipboard

Update Mixins page

Open ghost opened this issue 8 years ago • 2 comments

The mixins page should be updated to reflect that we now support intersection classes.

ghost avatar May 05 '17 20:05 ghost

Also from version 2.7 with --strictPropertyInitialization option enabled mixed properties require definite assignment assertion modifiers to be used:

class SmartObject implements Disposable, Activatable {
    constructor() {
        setInterval(() => console.log(this.isActive + " : " + this.isDisposed), 500);
    }

    interact() {
        this.activate();
    }

    // Disposable
    isDisposed: boolean = false;
    dispose!: () => void;
    // Activatable
    isActive: boolean = false;
    activate!: () => void;
    deactivate!: () => void;
}

lostintime avatar Feb 20 '18 16:02 lostintime

There is also some information on this here that could be used to update this section.

dsherret avatar Oct 07 '19 14:10 dsherret