Skip to main content

Async data import

The data attribute accepts an async function, too. This is useful for making any external HTTP calls and loading data from a server.

Here we have passed a function to the data attribute which returns a Promise object and resolves the data after 1 second:

Live Editor