Skip to content

A node.js-like library providing Promise for Android

Notifications You must be signed in to change notification settings

emranbm/ePromise

Repository files navigation

ePromise

A node.js-like library providing Promise for Android

Usage

new Promise(handle -> {

        // some work
        // This is done in an async task
        object value = ...;
        handle.resolve(value);

}).then((value, handle) -> {

        String upper = value.toString().toUpper();
        handle.resolve(upper);

});

Gradle

Add it in your root build.gradle at the end of repositories:

allprojects {
        repositories {
                ...
                maven { url 'https://jitpack.io' }
        }
}

Then add the dependency

dependencies {
        implementation 'com.github.emranbm:ePromise:1.2.0'
}

That's it!