1.0.0 • Published 12 months ago

optimistic-cart-web v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
12 months ago

Optimistic Cart Web

Features

  • Expose and share a Provider/Context that can use the cart functionality for any web project.

Installing

$ npm install optimistic-cart-web

Example

// for v3 payload
const cart = Cart.fromShopCart(data.json);
// or for v4 payload
const cart = Cart.from(data.json);

cart.items[1].setQuantity(5);

const total = cart.getTotal();
const subtotal = cart.getSubtotal();

Publish

npm install
npm run build
npm login
npm publish