after listening to https://egghead.io/courses/getting-started-with-redux
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 { chart } = require('rp-api'); | |
| const { forkJoin, of } = require('rxjs'); | |
| const { delay, tap, switchMap, mapTo } = require('rxjs/operators'); | |
| mockRequest(10, 'cid').pipe( | |
| switchMap(id => | |
| forkJoin( | |
| mockSendQueue([1, 2], id), | |
| mockRequest(10, 'sub').pipe( | |
| switchMap(subid => |
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 { chart } = require('rp-api'); | |
| const { from, timer } = require('rxjs'); | |
| const { delayWhen, share, map, timeout, catchError, repeat, take } = require('rxjs/operators'); | |
| const source$ = from([ 5, 20, 25, 30, 42, 45 ]) | |
| .pipe( | |
| delayWhen(timer) | |
| , share() | |
| ); |
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 { chart } = require('rp-api'); | |
| const { Observable, timer, merge } = require('rxjs'); | |
| const { take } = require('rxjs/operators'); | |
| function createTrackedObservable(onEmpty) { | |
| let count = 0; | |
| return new Observable(() => { | |
| count++; | |
| return ()=>{ | |
| count--; |
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 { rxObserver } = require('api/v0.3'); | |
| const { Observable, Subject, BehaviorSubject } = require('rxjs/Rx'); | |
| const trigger$ = Observable.of('o').delay(10); | |
| const source$ = Observable.interval(3).take(5); | |
| const afterTrigger$ = source$.skipUntil(trigger$); | |
| const result$ = | |
| source$ |
Currently we can imitate Arrays only with objects, where we would refer to a value at some position via referring to objects property ( with integer index being converted to a string )
var arr = {
"0" : "zero",
"1" : "one"
};
arr[ 1 ];But we wouldn't get all those features that original Array has (like length autoincremention, splice, split etc.)
this approach is based not on blocking some square on the screen, but rather blocking events from other device (after touch interaction mouse events are blocked for some period and vice versa)
note: its a draft for angular-hammer use, so one would need to modify it a little to use with native elements ( atm it accepts jQuery element and addresses dom via element[0] )
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
| 'use strict'; | |
| var DATA_TYPE_ATTR = 'text/html'; | |
| // a hack to include `dataTransfer` to $ events | |
| jQuery.event.props.push('dataTransfer'); | |
| angular.module( 'app', [] ) | |
| .controller ( 'main', function( $scope, dndBuffer ){ |
NewerOlder