This file contains hidden or 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
| async storeAccountInfo(username, password) { | |
| await storage.ready(); | |
| await storage.set('username', username); | |
| const cleanup = []; | |
| if ((await touchId.encrypt()).withFingerprint) { | |
| const [, secureStorage] = await Promise.all([ | |
| storage.set('usingTouchId', true), | |
| secureStorage = await secureStorageFactory.create(), | |
| ]); | |
| await secureStorage.set('password', password); |
This file contains hidden or 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
| // as a test function callback | |
| it('removes username', inject([Storage], async storage => { | |
| await storage.set('username', 'test user'); | |
| await storage.clear(); | |
| expect(await storage.get('username').toBeNull(); | |
| })); |
This file contains hidden or 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
| // Make an API asynchronous | |
| // In this example, we mock an iOS Keychain class. All operations | |
| // are async (I/O), so when we use this mock in our tests, we | |
| // want the operations to act async even though it's not needed | |
| // for the class to work | |
| class KeychainMock { | |
| store: [], | |
| async get(key) { | |
| return this.store[key] || null; | |
| } |
This file contains hidden or 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
| [1;32mdiff --git a/src/app/password/password.component.ts b/src/app/password/password.component.ts[0;0m | |
| [1;37mindex b430b39..d45eba9 100644[0;0m | |
| [1;31m--- a/src/app/password/password.component.ts[0;0m | |
| [1;34m+++ b/src/app/password/password.component.ts[0;0m | |
| [1;35m@@ -1,5 +1,5 @@[0;0m | |
| [1;31m-import { Component, ViewChild, Input, Output, forwardRef, EventEmitter } from '@angular/core';[0;0m | |
| [1;31m-import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';[0;0m | |
| [1;34m+import { Component, ViewChild, Input, Output, EventEmitter } from '@angular/core';[0;0m | |
| [1;34m+import { FormControl } from '@angular/forms';[0;0m | |
| [1;37m [0;0m |
This file contains hidden or 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
| diff --git a/src/app/password/password.component.ts b/src/app/password/password.component.ts | |
| index b430b39..d45eba9 100644 | |
| --- a/src/app/password/password.component.ts | |
| +++ b/src/app/password/password.component.ts | |
| @@ -1,5 +1,5 @@ | |
| -import { Component, ViewChild, Input, Output, forwardRef, EventEmitter } from '@angular/core'; | |
| -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; | |
| +import { Component, ViewChild, Input, Output, EventEmitter } from '@angular/core'; | |
| +import { FormControl } from '@angular/forms'; | |
This file contains hidden or 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
| const Foo = function () {} | |
| Foo.prototype.bar = "bar", | |
| Foo.prototype.arrow = () => { | |
| console.log(this.bar); | |
| }; | |
| Foo.prototype.fn = function () { | |
| console.log(this.bar); | |
| }; | |
| Foo.prototype.handyArrow = function () { | |
| process.nextTick(() => console.log(this.bar)); |
This file contains hidden or 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
| /** | |
| * Explanation of the issue causing login to break. This was fixed by | |
| * https://github.com/Mobiquity/TCP_Mobile/pull/514/files | |
| * | |
| * The functional change is that the `.mergeMap` and `.catch` are chained to the | |
| * inner Observable returned to `.switchMap`. Nothing is chained to `.switchMap` | |
| * | |
| * Originally, `.catch` was chained to `.switchMap`. This causes the Observable | |
| * to complete when `.catch` is reached. ngrx/effects will not resubscribe in | |
| * this case which may actually be a bug on their end, although this would be |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/add/observable/interval'; | |
| import 'rxjs/add/operator/switchMap'; | |
| import 'rxjs/add/operator/map'; | |
| import 'rxjs/add/operator/mapTo'; | |
| // This observable is subscribed to and emits observables | |
| Observable.interval(1000) |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
| import 'rxjs/add/observable/interval'; | |
| import 'rxjs/add/operator/switchMap'; | |
| import 'rxjs/add/operator/map'; | |
| import 'rxjs/add/operator/mapTo'; | |
| Observable.interval(1000) | |
| .switchMap(() => Observable.interval(100)) |
This file contains hidden or 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 { Observable } from 'rxjs/Observable'; | |
| import { of } from 'rxjs/Observable/of'; | |
| import 'rxjs/add/observable/from'; | |
| import 'rxjs/add/operator/switch'; | |
| import 'rxjs/add/operator/first'; | |
| const addresses = [ | |
| {name: "a", primary: false}, |