A Pen by Shivendrakmaurya on CodePen.
Discover gists
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
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 UIKit | |
import Vision | |
import AVFoundation | |
import Foundation | |
class ScanViewController: UIViewController { | |
private lazy var cameraPreviewLayer: AVCaptureVideoPreviewLayer = { | |
let l = AVCaptureVideoPreviewLayer(session: captureSession) | |
l.videoGravity = .resizeAspectFill | |
l.connection?.videoOrientation = .portrait |
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
const counter = createCounter(); // { increment: Function, decrement: Function, value: Number } | |
counter.increment(); | |
counter.value |
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
console.log('start') | |
setTimeout(() => { | |
console.log('setTimeout') | |
}) | |
Promise.resolve().then(() => { | |
console.log('resolve') | |
}) | |
console.log('end') |
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
const news = [ | |
"https://jsonplaceholder.typicode.com/posts/1", | |
"https://jsonplaceholder.typicode.com/posts/2", | |
"https://jsonplaceholder.typicode.com/posts/3", | |
"https://jsonplaceholder.typicode.com/posts/4", | |
"https://jsonplaceholder.typicode.com/posts/5", | |
"https://jsonplaceholder.typicode.com/posts/6", | |
"https://jsonplaceholder.typicode.com/posts/7", | |
"https://jsonplaceholder.typicode.com/posts/8", | |
"https://jsonplaceholder.typicode.com/posts/9", |
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
class Dog { | |
sound = "barking"; | |
} | |
class Lion { | |
sound = "roaring"; | |
} | |
const b: Lion = new Dog(); |
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
public poll$<T>( | |
request$: () => Observable<T>, | |
delayTime: number = this.getPollingInterval() | |
): Observable<T> { | |
return interval(delayTime).pipe( | |
switchMap(() => request$()) | |
); | |
} |
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
npm ls -g --depth=0 --link=true |
NewerOlder