up-down-counter
v0.0.3
Published
[![NPM version](https://badge.fury.io/js/up-down-counter.png)](http://badge.fury.io/js/up-down-counter) [![How big is this package in your project?](https://img.shields.io/bundlephobia/minzip/up-down-counter?style=for-the-badge)](https://bundlephobia.com
Downloads
5
Readme
up-down-counter
This is the famous counter test example for web components.
Note that the "run time" files for this web component are all html based. There are, however, some JS dependencies, due primarily to lack of love shown by the WHATWG towards end users.
However, to benefit from the tooling that JS provides, a few extra hops are supported, that splits the html file into two (a bundling step could combine them back into one, which would benefit initial load, but could hurt fine-grain caching).
The Typescript-safe definition for the binding is maintained in file root.mjs, which generates the html file which is designed as the distributed file reference for the web component.
To build the html file as you edit the mjs file, run:
npm run watch
to output to def.html.
Viewing up-down-counter locally
Any web server that can serve static files will do, but...
- Install git.
- Fork/clone this repo.
- Install node.js
- Open command window to folder where you cloned this repo.
npm install
npm run serve
- Open http://localhost:3030/demo/dev.html in a modern browser.