brunnopleffken/enchanter

onFinish callback

Closed this issue · 1 comments

can we add onFinish callback, so i could do validation cleanly.
maybe like:

    function validate() {
        ...
    }
    const enchanter = new Enchanter('js-form-wizard', {}, {
        onNext: () => {
            console.log('next');
            return validate();
        },
        onFinish: () => {
            console.log('finish');
            return validate();
        }
    });

Thank you for your contribution. Merged!