A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
{ | |
"bootstrapped": true, | |
"in_process_packages": | |
[ | |
], | |
"installed_packages": | |
[ | |
"Angular 2 Snippets (John Papa)", | |
"AngularJS", | |
"AutoFileName", |
import * as ng from '@angular/core'; | |
import {PusherService} from '../../services/pusher.service' | |
@ng.Component({ | |
selector: 'home', | |
template: require('./home.html') | |
}) | |
export class Home { | |
constructor(private pusher: PusherService) { | |
console.log('Home:constructor'); |
// Function | |
function wpex_video_oembed( $video = '', $classes = '', $params = array() ) { | |
// Define output | |
$output = ''; | |
// Sanitize URl | |
$video = esc_url( $video ); | |
// Video required |
In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.
This is how the demonstration will load data:
a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';
b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.
https://medium.com/@ExplosionPills/rxjs-switch-switchmap-and-other-map-operations-e8ccdfb7e5a9 is more up-to-date.
Exploring RxJS still feels like a jungle to me. Even when I think I understand something, I find out that I actually don't understand it. In my quest to truly understand it, I end up learning quite a lot more about some other topics or operations than the one I was originally trying to understand. This is generally a positive thing, but it still feels like traveling deep into a jungle to me.
Just today I was trying to learn how to use ngrx/store with ngrx/effects to use http
requests with an ngrx/store-backed app. This introduced me to the RxJS Observable
switchMap
operator that I was not familiar with. The main question I came up with -- the question that I usually have when
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
// Adjustments particular to this page to ensure we hit desktop breakpoint. | |
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1}); | |
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'}); |
pipeline { | |
/* run in any agent (a.k.a. node executor) */ | |
agent any | |
stages { | |
stage('Setup') { | |
steps { | |
script { | |
/* Check the GIT_BRANCH to compute the target environment */ | |
if (env.GIT_BRANCH == 'origin/develop' || env.GIT_BRANCH ==~ /(.+)feature-(.+)/) { |