function invokeServiceWorkerUpdateFlow() {
// you have a better UI here, reloading is not a great user experince here.
const confirmed = confirm('New version of the app is available. Refresh now');
if (confirmed) {
window.location.reload();
}
}
async function handleServiceWorker() {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:analyzer/dart/ast/ast.dart'; | |
import 'package:analyzer/dart/element/type.dart'; | |
import 'package:analyzer/error/error.dart'; | |
import 'package:analyzer/error/listener.dart'; | |
import 'package:analyzer/source/source_range.dart'; | |
import 'package:custom_lint_builder/custom_lint_builder.dart'; | |
class PreferTimestampsToLocalDateTimes extends DartLintRule { | |
PreferTimestampsToLocalDateTimes() : super(code: _code); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Types for the version of Web NFC available in Chrome for Android | |
* | |
* The spec is similar to, but does not exactly match https://w3c.github.io/web-nfc/releases/20151112/ | |
*/ | |
declare global { | |
interface Navigator { | |
nfc: WebNFC | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Add this to your app's SharedModule declarations | |
*/ | |
import { Directive, ElementRef, Input } from '@angular/core'; | |
// nativescript | |
import { View } from 'tns-core-modules/ui/core/view'; | |
import { Animation, AnimationDefinition } from 'tns-core-modules/ui/animation'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// angular | |
import {Component} from '@angular/core'; | |
@Component({ | |
moduleId: module.id, | |
selector: 'app', | |
template: ` | |
<StackLayout> | |
<page-router-outlet></page-router-outlet> | |
</StackLayout> |
By: @BTroncone
Also check out my lesson @ngrx/store in 10 minutes on egghead.io!
Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!
Table of Contents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// webpack is a module bundler | |
// This means webpack takes modules with dependencies | |
// and emits static assets representing those modules. | |
// dependencies can be written in CommonJs | |
var commonjs = require("./commonjs"); | |
// or in AMD | |
define(["amd-module", "../file"], function(amdModule, file) { | |
// while previous constructs are sync | |
// this is async |