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
(function (name, definition, global) { | |
if (typeof define === 'function') { | |
define(definition); | |
} else if (typeof module !== 'undefined' && module.exports) { | |
module.exports = definition(); | |
} else { | |
global[name] = definition(); | |
} | |
})('detectIDB', function () { |
/** | |
* Copyright 2017 Google Inc. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
// Get binary file using XMLHttpRequest | |
function getBinary(file) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", file, false); | |
xhr.overrideMimeType("text/plain; charset=x-user-defined"); | |
xhr.send(null); | |
return xhr.responseText; | |
} | |
// Base64 encode binary string |
#!/usr/bin/env bash | |
# fresh-chrome | |
# | |
# Use this script on OS X to launch a new instance of Google Chrome | |
# with its own empty cache, cookies, and user configuration. | |
# | |
# The first time you run this script, it will launch a new Google | |
# Chrome instance with a permanent user-data directory, which you can | |
# customize below. Perform any initial setup you want to keep on every |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>T11</title> | |
<style> | |
body { | |
margin: 0; | |
padding: 0; | |
background-color: #000000; |
on alfred_script(q) | |
if not (q starts with "http://") and not (q start with "pw") | |
set q to "http://" & q | |
end if | |
tell application "/Applications/Google Chrome.app" | |
if it is running then | |
if (q start with "pw") | |
open location "chrome://settings/passwords" | |
else | |
open location q |
(function () { | |
// IndexedDB | |
var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, | |
IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, | |
dbVersion = 1.0; | |
// Create/open database | |
var request = indexedDB.open("elephantFiles", dbVersion), | |
db, | |
createObjectStore = function (dataBase) { |
export type TaskPriority = "user-blocking" | "user-visible" | "background"; | |
export type SchedulerPostTaskOptions = { | |
// This priority is immutable and overrides the | |
// TaskController's priority. | |
priority?: TaskPriority; | |
delay?: number; | |
signal?: TaskSignal; | |
}; |
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
Facades are a programming pattern in which a simpler public interface is provided to mask a composition of internal, more-complex, component usages.
When writing a lot of NgRx code - as many enterprises do - developers quickly accumulate large collections of actions and selectors classes. These classes are used to dispatch and query [respectively] the NgRx Store.
Using a Facade - to wrap and blackbox NgRx - simplifies accessing and modifying your NgRx state by masking internal all interactions with the Store
, actions
, reducers
, selectors
, and effects
.
For more introduction, see Better State Management with Ngrx Facades