Skip to content

v2.4.0

Latest
Compare
Choose a tag to compare
@finom finom released this 14 Apr 20:18

2.4.0 (2017-04-14)

Features

  • calc: Allow to use promises via promiseCalc flag (dea2e987)
this.calc('a', ['b', 'c'], (b, c) => {
    return new Promise(resolve => {
        setTimeout(() => {
            resolve(a + b)
        }, 1000);
    });
}, { promiseCalc: true });

this.b = 1;
this.c = 2;

// "a" will be changed in a second
this.calc('response', 'data', async (data) => {
    const resp = await fetch(url, {
        method: 'post',
        body: data
    });

    return resp.json();
}, { promiseCalc: true });