Here's my quick attempt to build a tiny preact app using terminology from Angular 1.
# get it
git clone https://gist.github.com/e5de4c33c1a8d8fd172905010d3ff75c.git preact-for-angular1-users
cd preact-for-angular1-users| { | |
| "rewrites": [ | |
| { | |
| "source": "**", | |
| "destination": "/index.html" | |
| } | |
| ], | |
| "headers": [ | |
| { | |
| "source": "**", |
A Preact PWA port of Eric Bidelman's Lighthouse Viewer app. Zero-config PWA build powered by preact-cli.
Try it out: lighthouse-viewer.surge.sh.
| var path = require('path').join(__dirname, '..', 'package.json'); | |
| var pkg = require(path); | |
| ['babel', 'greenkeeper', 'bundlesize', 'devDependencies', 'eslintConfig'].forEach(function(key) { delete pkg[key] }); | |
| pkg.scripts = { postinstall: pkg.scripts.postinstall, donate: pkg.scripts.donate }; | |
| require('fs').writeFileSync(path, JSON.stringify(pkg, null, 2)); |
A tiny (265 byte) utility to create state machine components using two pure functions.
The API is a single function that accepts 2 pure functions as arguments:
| node_modules | |
| npm-debug.log | |
| dist | |
| build |
| { | |
| "window.zoomLevel": 0, | |
| "editor.fontFamily": "'Source Code Pro', Menlo, Monaco, 'Courier New', monospace", | |
| "editor.fontSize": 12, | |
| "editor.insertSpaces": false, | |
| "editor.minimap.enabled": false, | |
| "editor.quickSuggestionsDelay": 100, | |
| "editor.multiCursorModifier": "ctrlCmd", | |
| "editor.formatOnPaste": false, | |
| "editor.suggestFontSize": 11, |
| dialog { | |
| position: fixed; | |
| top: 50%; | |
| left: 50%; | |
| right: auto; | |
| padding: 30px; | |
| transform: perspective(500px) translate(-50%, -50%); | |
| background: linear-gradient(to bottom, #FFF, #F4F4F4) #FFF; | |
| border: none; | |
| border-radius: 3px; |
| import { options } from 'preact'; | |
| let def = { | |
| get() { | |
| return this.class; | |
| }, | |
| set(v) { | |
| this.class = v; | |
| } | |
| }; |