shopper
Version:
plug shopify into any website
16 lines (13 loc) • 474 B
text/typescript
import {ShopperModel} from "../interfaces.js"
import {provideModel} from "./provide-model.js"
import {ShopperComponent} from "./shopper-component.js"
export function wireModelToComponents(
model: ShopperModel,
components: {[key: string]: typeof ShopperComponent}
) {
const newComponents: {[key: string]: typeof ShopperComponent} = {}
for (const [key, value] of Object.entries(components)) {
newComponents[key] = provideModel(model, value)
}
return newComponents
}