Skip to content

Instantly share code, notes, and snippets.

@j3k0
Created May 26, 2020 07:10
Show Gist options
  • Save j3k0/0c0c9217c63944d11f7b1d8a0ec43821 to your computer and use it in GitHub Desktop.
Save j3k0/0c0c9217c63944d11f7b1d8a0ec43821 to your computer and use it in GitHub Desktop.
angular in-app purchase example
function sync() {
$scope.ready = store.ready();
$scope.product = Object.assign({}, store.get("my_product_id"));
}
const dsync = window.debounce(sync, 50);
$scope.$on("$ionicView.beforeEnter", function () {
dsync();
store.when("my_product_id").updated(dsync);
});
$scope.$on("$ionicView.beforeLeave", function () {
store.off(dsync);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment