import EventEmitter from 'eventemitter3';

/** Base unit of async work that ActivityRunner can execute. */
export default class Activity extends EventEmitter
{
    public readonly name: string;

    constructor(name: string)
    {
        super();
        this.name = name;
    }

    /** Executes the activity; subclasses override to add behaviour. */
    async execute(): Promise<void>
    {
    }

    /** Reverts the activity if it supports undo. */
    async undo(): Promise<void>
    {
    }
}
