https://github.com/nichoth/h-shopping-cart
Static render function for shopping cart widget
https://github.com/nichoth/h-shopping-cart
Last synced: about 2 months ago
JSON representation
Static render function for shopping cart widget
- Host: GitHub
- URL: https://github.com/nichoth/h-shopping-cart
- Owner: nichoth
- Created: 2016-03-31T22:23:55.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-31T22:55:18.000Z (almost 10 years ago)
- Last Synced: 2026-03-21T00:30:30.707Z (4 months ago)
- Language: JavaScript
- Homepage: https://github.com/nichoth/h-shopping-cart#readme
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# h shopping cart
Work in progress. Pass in a hyperscript function and data object, return HTML.
## install
$ npm install h-shopping-cart
## demo
[http://demos.nichoth.com/h-shopping-cart](http://demos.nichoth.com/h-shopping-cart
)
## example
```js
var renderCart = require('h-shopping-cart')
var bel = require('bel')
var style = require('h-shopping-cart/index.csjs') // csjs styles
var cart = renderCart(bel, {
rows: [
{
delete: bel`delete`
title: 'Example Product',
quantity: '3',
priceEach: '$7',
priceTotal: '$' + 7*3
}
]
})
document.body.appendChild(cart)
```