Last active
March 21, 2020 12:35
Revisions
-
BioPhoton revised this gist
Mar 21, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -111,7 +111,6 @@ import {TestScheduler} from 'rxjs/internal/testing/TestScheduler'; const testScheduler = new TestScheduler(observableMatcher); testScheduler.run(({cold, hot, expectObservable, expectSubscriptions}) => { const s1 = hot('-^-x------------------| '); const s1Subs = ' ^--------------------! '; const n1 = cold(' ------------------------|'); -
BioPhoton revised this gist
Mar 21, 2020 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -72,6 +72,13 @@ describe.only('`^`', () => { - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions ## Guide lines ### 0 index usage The zero index exists only in hot observables and can be specified by using `^`. If not specified it exists implizitly at the beginning of an hot observable. ```typescript hot('----|') === hot(' ----|') === hot('^---|') === hot(' ^---|') hot('-^---|') === hot('-^---|') :D ``` ### 0 index alignment -
BioPhoton revised this gist
Mar 21, 2020 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -105,10 +105,10 @@ const testScheduler = new TestScheduler(observableMatcher); testScheduler.run(({cold, hot, expectObservable, expectSubscriptions}) => { const s1 = hot('-^-x------------------| '); const s1Subs = ' ^--------------------! '; const n1 = cold(' ------------------------|'); const n1Subs = [' --^------------------! ']; const exp = ' --x------------------| '; }) ``` -
BioPhoton revised this gist
Mar 21, 2020 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ ## Confusing - `(` and `)` count as frame ```typescript describe('`(` and `)`', () => { @@ -70,9 +71,10 @@ describe.only('`^`', () => { - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions ## Guide lines ### 0 index alignment ```typescript // Old style ================== -
BioPhoton revised this gist
Mar 21, 2020 . 1 changed file with 42 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -68,4 +68,45 @@ describe.only('`^`', () => { }); ``` - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions **Guide lines** 0 index alignment: ```typescript // Old style ================== import { hot, cold, expectObservable, expectSubscriptions } from '../helpers/marble-testing'; const s1 = hot('-^-x------------------|'); const s1Subs = '^ !'; const n1 = cold(' ------------------------|'); const n1Subs = [' ^ !']; const exp = '--x------------------|'; // New style ================== import {TestScheduler} from 'rxjs/internal/testing/TestScheduler'; const testScheduler = new TestScheduler(observableMatcher); testScheduler.run(({cold, hot, expectObservable, expectSubscriptions}) => { const s1 = hot('-^-x------------------| '); const s1Subs = '^--------------------! '; const n1 = cold('------------------------|'); const n1Subs = ['--^------------------! ']; const exp = '--x------------------| '; // New style proper 0 index alignment ================== import {TestScheduler} from 'rxjs/internal/testing/TestScheduler'; const testScheduler = new TestScheduler(observableMatcher); testScheduler.run(({cold, hot, expectObservable, expectSubscriptions}) => { const s1 = hot('-^-x------------------|'); const s1Subs = ' ^--------------------!'; const n1 = cold(' -------------------|'); const n1Subs = [' --^------------------!']; const exp = ' --x------------------|'; }) ``` -
BioPhoton revised this gist
Mar 20, 2020 . 1 changed file with 30 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -38,4 +38,34 @@ describe('`(` and `)`', () => { }); ``` - `^` only exists in hot observables ```typescript describe.only('`^`', () => { let testScheduler: TestScheduler; beforeEach(() => { testScheduler = new TestScheduler(observableMatcher); }); it('should take one frame', () => { const a = cold('-1---|'); const a1 = '-1---|'; const aSubs = [ '^----!' ]; const ar = a.pipe(tap()); expectObservable(ar).toBe(a1); expectSubscriptions(a.subscriptions).toBe(aSubs); }); it('should exist only on hot observables and outputs ans subscriptions', () => { testScheduler.run(({hot, expectObservable}) => { const a = hot('^1----------|'); const a1 = '^1----------|'; const aSubs = '^-----------!'; const ar = a.pipe(tap()); expectObservable(ar).toBe(a1); expectSubscriptions(a.subscriptions).toBe(aSubs); }); }); }); ``` - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions -
BioPhoton revised this gist
Mar 20, 2020 . 1 changed file with 26 additions and 18 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,26 +8,34 @@ describe('`(` and `)`', () => { testScheduler = new TestScheduler(observableMatcher); }); describe.only('`(` and `)`', () => { let testScheduler: TestScheduler; beforeEach(() => { testScheduler = new TestScheduler(observableMatcher); }); it('should take one frame for `(` and one frame for `)`', () => { testScheduler.run(({cold, hot, expectObservable}) => { const a = cold('---------------|'); const a1 = '-()------------|'; const b = cold('----1----------|'); const b1 = '-()-(1)--------|'; const b2 = '-()-(1)--()----|'; const c = cold('----1----(23)--|'); const c1 = '-()-(1)()(23)--|'; const c2 = '-()-(1)()(23)--|'; const c3 = '-()-(1)()(23)()|'; expectObservable(a).toBe(a1); expectObservable(b).toBe(b1); expectObservable(b).toBe(b2); expectObservable(c).toBe(c1); expectObservable(c).toBe(c2); expectObservable(c).toBe(c3); }); }); }); ``` - `^` only exists in hot observables - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions -
BioPhoton revised this gist
Mar 20, 2020 . 1 changed file with 29 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,33 @@ Confusing: - `(` and `)` count as frame ```typescript describe('`(` and `)`', () => { let testScheduler: TestScheduler; beforeEach(() => { testScheduler = new TestScheduler(observableMatcher); }); it('should should take one frame for `(` and one framr for `)`', () => { testScheduler.run(({cold, hot, expectObservable}) => { const a = cold('---------------|'); const a1 = '-()------------|'; const b = cold('----1----------|'); const b1 = '-()-(1)--------|'; const b2 = '-()-(1)--()----|'; const c = cold('----1----(23)--|'); const c1 = '-()-(1)()(23)--|'; const c2 = '-()-(1)()(23)--|'; const c3 = '-()-(1)()(23)()|'; expectObservable(a).toBe(a1); expectObservable(b).toBe(b1); expectObservable(b).toBe(b2); expectObservable(c).toBe(c1); expectObservable(c).toBe(c2); expectObservable(c).toBe(c3); }); }); }); ``` - `^` only exists in hot observables - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions -
BioPhoton revised this gist
Mar 20, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ Confusing: - `(` and `)` count as frame - `^` only exists in hot observables - ` ` is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions -
BioPhoton revised this gist
Mar 20, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ Confusing: - `(` and `)` count as frame - `^` only exists in hot observables - ' ' is ignored in cold and hot observables due to time progression syntax, but considered as frame in subscriptions -
BioPhoton created this gist
Mar 20, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ Confusing: - `(` and `)` count as frame - `^` only exists in hot observables