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
| // 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 | 
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
| // angular | |
| import {Component} from '@angular/core'; | |
| @Component({ | |
| moduleId: module.id, | |
| selector: 'app', | |
| template: ` | |
| <StackLayout> | |
| <page-router-outlet></page-router-outlet> | |
| </StackLayout> | 
| /** | |
| * 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'; | 
| /** | |
| * 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 | |
| } | 
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() {| 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); |