@ribajs/shopify
Advanced tools
Comparing version 1.9.0-alpha.1 to 1.9.0-alpha.2
{ | ||
"name": "@ribajs/shopify", | ||
"description": "Shopify extension for Riba.js", | ||
"version": "1.9.0-alpha.1", | ||
"version": "1.9.0-alpha.2", | ||
"author": "Pascal Garber <pascal@artandcode.studio>", | ||
@@ -6,0 +6,0 @@ "contributors": [], |
@@ -5,3 +5,2 @@ import { Component } from "@ribajs/core"; | ||
import template from "./shopify-cart-item.component.html"; | ||
import { TouchEventsService } from "../../../../extras/src"; | ||
@@ -211,2 +210,7 @@ export interface Scope { | ||
protected async beforeBind() { | ||
// const cart = await ShopifyCartService.get(); | ||
} | ||
protected async afterBind() { | ||
this.debug("afterBind", this.scope); | ||
ShopifyCartService.shopifyCartEventDispatcher.on( | ||
@@ -230,9 +234,2 @@ "ShopifyCart:request:start", | ||
protected async afterBind() { | ||
this.debug("afterBind", this.scope); | ||
return ShopifyCartService.get().catch((error: Error) => { | ||
console.error(error); | ||
}); | ||
} | ||
protected template() { | ||
@@ -239,0 +236,0 @@ // Only set the component template if there no childs already |
@@ -188,4 +188,4 @@ import { Component } from "@ribajs/core"; | ||
this.debug("afterBind", this.scope); | ||
if (!this.scope.cart) { | ||
this.scope.cart = await ShopifyCartService.get(); | ||
if (!this.cart) { | ||
this.cart = await ShopifyCartService.get(); | ||
} | ||
@@ -192,0 +192,0 @@ } |
@@ -73,2 +73,11 @@ import { EventDispatcher, HttpService } from "@ribajs/core"; | ||
public static refresh(): Promise<ShopifyCartObject> { | ||
return HttpService.get(this.CART_GET_URL, {}, "json").then( | ||
(cart: ShopifyCartObject) => { | ||
ShopifyCartService.cart = cart; | ||
return cart; | ||
} | ||
); | ||
} | ||
public static _get(): Promise<ShopifyCartObject> { | ||
@@ -86,8 +95,3 @@ if (ShopifyCartService.cart !== null) { | ||
} | ||
return HttpService.get(this.CART_GET_URL, {}, "json").then( | ||
(cart: ShopifyCartObject) => { | ||
ShopifyCartService.cart = cart; | ||
return cart; | ||
} | ||
); | ||
return ShopifyCartService.refresh(); | ||
} | ||
@@ -94,0 +98,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
208912