Native Loading Spinner SDK

Show native loading indicators during app processes.

Written By despia

Last updated About 1 year ago

SDK Usage

// Show spinner
window.despia = "spinneron://"

// Hide spinner
window.despia = "spinneroff://"

Examples

Basic Loading

// Start loading
window.despia = "spinneron://"

// Your process here
fetchData()

// Stop loading
window.despia = "spinneroff://"

Async Operations

async function loadData() {
    window.despia = "spinneron://"
    
    try {
        await fetchData()
    } finally {
        window.despia = "spinneroff://"
    }
}

User Actions

function onButtonPress() {
    window.despia = "spinneron://"
    
    saveData().then(() => {
        window.despia = "spinneroff://"
    })
}

Tips

  • Always hide spinner after completion

  • Use try/finally for error handling

  • Don't show for quick operations

  • Keep loading times reasonable

  • Test different scenarios


Need help? Email us at support@despia.com