diff --git a/README.md b/README.md index b437c8b..929dd66 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Next actions: 1. [Read the docs](https://webcomponent.io) 2. [View demos with code examples](https://demo.webcomponent.io/) 3. [Play with a demo on CodePen](https://codepen.io/ayo-run/pen/ZEwoNOz?editors=1010). +4. [Try it on TypeScript playground](https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgdQKYCMDCFwQHap4wA0cAFjCADZwC+cAZlDnAOQDuGAtAMY6QEiXdAEMAzqlYAoKQHpZcGGVSKAnmBUj0EAG6pSSlQBNUDEQFcqMMXHbAlwPHEAoBHAmo5CijDBiAXPKc6Hy4gjAAdMAQsmDMYFwiPDyoYmKyAMQw6qhGXLEQvlyOXFkaYjxQwGAwUqUqyDzoAELmMDD4AApxNgC8iFJwcFRaqFR+bjCVeADmA3BGwGJaVDnj2hArInhzPFTAPADW-nB45iDoqFBStDKyAFR3A3dwAIITIrCXcCEChBFwAFE9FBVHADqhQY44AADMQwEQwfZwfK+aFwRZwERwKCoRKIvTIuKXLJPbGmFY8GA5RQQTFgjBaXjiakIybAdCtFSudiVREzGEOMThFFC3b7I4Aagl0NJ5jARgRKUUykxbUqHKpmLwRjJXBx2suQpheDAIGx5icWxEVFUAC9UGiYOYoHgbIY3CIQB44M8TLsPgiok5HO01BodX9KkqodCeOY4TguKNUF6iEKAFZifDQ8JPWRSVAAD0gsG+w1SKEaLTa+DgRap2psaCw-HwfwAPA1mq12ngugUxAA+fqDOGBniEgfjLvV3v93xwPoIOaDYYXMZsTB7Q5wL2sYgr+aLZarRjWiQHwaDMWHY4ABkvdBkgw54EXcAAFABKRfD5dX9EGE-ABCQVhW6cIFiWdAViMH8wJFcIb0lCU5huOZplQeAqXAYYqW-EcrxxJ0XXISgqBlADBnbDVezgfBkJ6AASBAwNfMB6Cgk8jGY1iyEWcCB0g48YJyWhB0PACWIQiC11GehXGk-ihUQ5CxFoAB1yS4HbWRaPwCSAMop90LjBMQABFZU2sSDTEcVAPw4RphB7fB90rbsazwL8gA) ![counter example code snippet](https://git.ayo.run/ayo/wcb/raw/branch/main/assets/IMG_0682.png) diff --git a/create/template/src/wcb-button.ts b/create/template/src/wcb-button.ts index bcd20a9..5a94bb9 100644 --- a/create/template/src/wcb-button.ts +++ b/create/template/src/wcb-button.ts @@ -1,7 +1,11 @@ import { WebComponent, html } from 'web-component-base' -// the type above, the defaults within — see -// https://webcomponent.io/prop-access/#typed-props-in-typescript +/** + * Declare a type for your `static props` + * It is not required for wcb to work, but rather an + * opt-in compile-time type safety with Typescript + * @see https://webcomponent.io/prop-access/#opt-in-typed-props-in-typescript + */ type WcbButtonProps = { label: string disabled: boolean @@ -11,8 +15,7 @@ type WcbButtonProps = { /** * A starter component. Every key in `static props` is a reactive property * reflected to a kebab-cased attribute — writing `this.props.clicks++` - * updates the attribute and re-renders. `npm run analyze` turns the same - * declaration into typed entries in `custom-elements.json`. + * updates the attribute and re-renders. */ export class WcbButton extends WebComponent { static props: WcbButtonProps = {