Skip to content

Instantly share code, notes, and snippets.

@agoalofalife
Created December 1, 2017 04:33
Show Gist options
  • Save agoalofalife/d57bb5e03dfd8c5382adae608cde17d7 to your computer and use it in GitHub Desktop.
Save agoalofalife/d57bb5e03dfd8c5382adae608cde17d7 to your computer and use it in GitHub Desktop.
```js
let basePriceProduct = new basis.Token(0);
// price up for some thing
let priceUp = basePriceProduct.as(function(basePrice) {
var priceUp = basePrice/100 * 10;
return basePrice+priceUp;
})
let priceAfterLogistic = priceUp.as(function(basePrice){
return basePrice + basePrice/100 * 10;
});
basePriceProduct.set(100); // set base price
// price with up
basePriceProduct.get();
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment