Sha256: 6df64bf36bee673cc680a640bf42474794d8744112a6e6f4a5c8b2a997c0de0e

Contents?: true

Size: 415 Bytes

Versions: 29

Compression:

Stored size: 415 Bytes

Contents

const AsyncUtil = {
    /// Resolves on the next animation frame
    nextAnimationFrame() {
        return new Promise(resolve => {
            requestAnimationFrame(() => resolve());
        });
    },

    /// Resolve in [duration] milliseconds
    waitMillis(duration) {
        return new Promise(resolve => {
            setTimeout(() => resolve(), duration);
        });
    },
};

export default AsyncUtil;

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
hematite-0.1.18 assets/js/AsyncUtil.mjs
hematite-0.1.17 assets/js/AsyncUtil.mjs
hematite-0.1.16 assets/js/AsyncUtil.mjs
hematite-0.1.15 assets/js/AsyncUtil.mjs
hematite-0.1.14 assets/js/AsyncUtil.mjs
hematite-0.1.13 assets/js/AsyncUtil.mjs
hematite-0.1.12 assets/js/AsyncUtil.mjs
hematite-0.1.11 assets/js/AsyncUtil.mjs
hematite-0.1.10 assets/js/AsyncUtil.mjs
hematite-0.1.9 assets/js/AsyncUtil.mjs
hematite-0.1.8 assets/js/AsyncUtil.mjs
hematite-0.1.7 assets/js/AsyncUtil.mjs
hematite-0.1.6 assets/js/AsyncUtil.mjs
hematite-0.1.5 assets/js/AsyncUtil.mjs
hematite-0.1.4 assets/js/AsyncUtil.mjs
hematite-0.1.3 assets/js/AsyncUtil.mjs
hematite-0.1.2 assets/js/AsyncUtil.mjs
hematite-0.0.12 assets/js/AsyncUtil.mjs
hematite-0.0.11 assets/js/AsyncUtil.mjs
hematite-0.0.10 assets/js/AsyncUtil.mjs