I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
import { h, Component } from 'preact'; | |
import { Router } from 'preact-router'; | |
import Header from './header'; | |
import Home from '../routes/home'; | |
import Profile from '../routes/profile'; | |
import NotifyChange from "./NotifyChange/index"; | |
// import Home from 'async!../routes/home'; | |
// import Profile from 'async!../routes/profile'; |
<!-- | |
- | |
- US Zip Codes are text (not numbers) made up of digits (and optionally the dash character, if you accept 9 digit codes) | |
- | |
- Number input fields will drop leading zeros and may add numeric formatting (ie- add commas) to the input. This behavior | |
- is incorrect for Zip Codes which can have leading zeros and should not include commas. | |
- | |
- This Gist shows the incorrect and correct way to tell the browser what is expected in a Zip Code field. Oddly, HTML5 | |
- adds 'date', 'time' and 'tel' types to input elements, but does not include 'zip'. | |
- |
I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.
I read the spec, some blog posts, and looked through some code. I learned how to
if (typeof window!=='undefined' && navigator.serviceWorker && navigator.serviceWorker.controller) { | |
let reloadOnNext = false; | |
let pushState = history.pushState; | |
history.pushState = function(state, title, url) { | |
pushState.call(this, state, title, url); | |
if (reloadOnNext===true) location.reload(true); | |
}; | |
navigator.serviceWorker.controller.addEventListener('statechange', e => { |
const path = require('path'); | |
const webpack = require('webpack'); | |
const NameAllModulesPlugin = require('name-all-modules-plugin'); | |
module.exports = { | |
entry: { | |
main: './src/foo', | |
other: './src/foo-two', | |
vendor: ['preact'] | |
}, |