Skip to content

Callback API

Aferdita Muriqi edited this page Nov 11, 2019 · 3 revisions

R2D2BC

Callback API

<script>
    
    D2Reader.load({
        url: new URL("http....."),
        api: {
            updateCurrentlocation: function (location) {
                return new Promise(function (resolve, reject) {
                    resolve(
                        location
                    )
                })
            }
        }
    }).then(instance => {
        console.log("D2Reader loaded ", instance);
    }).catch(error => {
        console.error("error.message ", error.message);
    });

</script>