import alt from '../alt'

class FileActions
{
    openFile(path = '') {
        this.dispatch(path);
    }

    previewFile(path = '') {
        this.dispatch(path);
    }

    closeFile(id) {
        this.dispatch(id);
    }

    setCurrentFile(id) {
        this.dispatch(id);
    }

    setFileModified(path) {
        this.dispatch(path);
    }

    setFileUnmodified(path) {
        this.dispatch(path);
    }

    checkFileForModifications(id) {
        this.dispatch(id);
    }

    moveFile(fromIndex, toIndex) {
        this.dispatch({ fromIndex, toIndex });
    }
}

var filesActions = alt.createActions(FileActions)

export default filesActions

import alt from '../alt'

class FileActions
{
    constructor() {
        this.generateActions(
            'closeFile',
            'setCurrentFile',
            'setFileModified',
            'setFileUnmodified',
            'checkFileForModifications',
            'save'
        );
    }

    openFile(path = '') {
        this.dispatch({ path });
    }

    previewFile(path = '') {
        this.dispatch(path);
    }

    moveFile(fromIndex, toIndex) {
        this.dispatch({ fromIndex, toIndex });
    }
}

var filesActions = alt.createActions(FileActions)

export default filesActions

Simplify file actions