Skip to main content

DataSource

DataSource is a core EDL component that facilitates data fetching and state management.

Usage

// Using string identifier
<DataSource
:dataSource="shopify-products"
:as="products"
>
<Text :forEach={products} :as="product">
{product.title}
</Text>
</DataSource>

// Using object configuration
<DataSource
:dataSource={{ type: 'shopify-product', productHandle: 'test-product' }}
:as="product"
>
<Text>Product name: {product.title}</Text>
</DataSource>

Props

:dataSource

Type: string | DataSourceConfig Required: true

The identifier of the data source to fetch from. Can be either:

  • A string value (e.g., "shopify-products")
  • An object with configuration (e.g., { type: 'shopify-product', productHandle: 'test-product' })

:as

Type: string Required: true

The name to use when accessing the fetched data in child components.