Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Поддержка Promises #16

Open
wmakeev opened this issue May 29, 2015 · 0 comments
Open

Поддержка Promises #16

wmakeev opened this issue May 29, 2015 · 0 comments

Comments

@wmakeev
Copy link
Owner

wmakeev commented May 29, 2015

Реализовать поддержку Promises в асинхронном режиме.

Учитывая грядущие в ES7 async/await, такая возможность даст значительные преимущества

var action = async function (uuid) {
    var order;
    var client = require('moysklad-client').createClient();
    await client.loadMetadata();
    try {
        order = await client.load('customerOrder', uuid);
    } catch (err) {
        // обработка ошибки
        throw err;
    } 
    ...
    return order;
}

action('08ed3f99-3e2f-11e3-f600-7054d21a8d1e').then(function(order) {
    console.log(order.name);
}).catch(function(err) {
    throw err;
})
@wmakeev wmakeev added this to the 0.3.0 milestone Apr 2, 2016
wmakeev added a commit that referenced this issue Apr 23, 2016
Добавление поддержки Promises
wmakeev added a commit that referenced this issue Apr 24, 2016
- рефакторинг внутренней структуры кода #16
- покрытие тестами #12
- корректировка Gruntfile (fubers, sleep, env)
- добавлена зависимость have2
wmakeev added a commit that referenced this issue Apr 24, 2016
Модификация с учетом Promises #16 и Fibers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant