Skip to content

Commit

Permalink
Merge pull request #479 from ardoq/kill-markers
Browse files Browse the repository at this point in the history
Remove markers and performance measurement
  • Loading branch information
tlaundal authored Aug 26, 2022
2 parents 165b877 + 49b3840 commit fcfce5c
Show file tree
Hide file tree
Showing 21 changed files with 10 additions and 841 deletions.
3 changes: 1 addition & 2 deletions src/action$.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Subject } from 'rxjs';
import { UnknownAction, markName } from './internal';
import { UnknownAction } from './internal';
import { ActionDispatcher, ActionStream } from './types/helpers';
import { tag } from 'rxjs-spy/operators';
import { share } from 'rxjs/operators';
Expand All @@ -12,7 +12,6 @@ const actionSubject$ = new Subject<UnknownAction>();
*/
export const action$: ActionStream = actionSubject$.pipe(
tag('action$'),
markName('action$'),
share()
);

Expand Down
2 changes: 0 additions & 2 deletions src/actionCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
ActionCreatorWithPayload,
ActionCreatorWithoutPayload,
} from './types/ActionCreator';
import { actionMarker } from './internal/markers';

type ActionName = `[${string}] ${string}`;

Expand Down Expand Up @@ -42,7 +41,6 @@ export const actionCreator: ActionCreatorFunc = (type: string) => {
meta: Object.freeze({}),
});
actionCreatorFn.type = type;
actionCreatorFn._marker = actionMarker(type);

return Object.freeze(actionCreatorFn);
};
110 changes: 0 additions & 110 deletions src/decoratedObservableCombiners.spec.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/decoratedObservableCombiners.ts

This file was deleted.

35 changes: 0 additions & 35 deletions src/derivedStream.spec.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,7 @@
import test from 'ava';
import {
MarkerType,
NameMarker,
findMarker,
markName,
} from './internal/markers';
import { Observable } from 'rxjs';
import { derivedStream } from './derivedStream';
import { marbles } from 'rxjs-marbles/ava';

test('derivedStream adds name and combine marker', (t) => {
const source$ = new Observable<unknown>().pipe(markName('source'));
const dependency$ = source$.pipe(markName('dependency'));

const derived$ = derivedStream('derived', source$, dependency$);

const sourceNameMarker: NameMarker = {
type: MarkerType.NAME,
name: 'source',
sources: [null],
};
const dependencyNameMarker: NameMarker = {
type: MarkerType.NAME,
name: 'dependency',
sources: [sourceNameMarker],
};
t.deepEqual(findMarker(derived$), {
type: MarkerType.NAME,
name: 'derived',
sources: [
{
type: MarkerType.COMBINE_LATEST,
sources: [sourceNameMarker, dependencyNameMarker],
},
],
});
});

test(
'derivedStream emits on emit from either source',
marbles((m) => {
Expand Down
9 changes: 4 additions & 5 deletions src/derivedStream.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Observable, ObservableInput } from 'rxjs';
import { combineLatest } from './decoratedObservableCombiners';
import { markName } from './internal/markers';
import { Observable, ObservableInput, combineLatest } from 'rxjs';
import { tag } from 'rxjs-spy/operators';

export type DerivedStream = {
<A>(name: string, a: ObservableInput<A>): Observable<[A]>;
Expand Down Expand Up @@ -95,7 +94,7 @@ export type DerivedStream = {
* Make this stream a derived stream of its source and dependencies
*
* This is basically an annotated version of the `combineLatest` operator that
* adds markers so the stream can be analyzed.
* adds tags so the stream can be analyzed.
*
* @param name The unique name of this stream
* @param dependencies The dependencies of this stream
Expand All @@ -104,4 +103,4 @@ export type DerivedStream = {
export const derivedStream: DerivedStream = (
name: string,
...dependencies: ObservableInput<unknown>[]
): Observable<any> => combineLatest(...dependencies).pipe(markName(name));
): Observable<any> => combineLatest(dependencies).pipe(tag(name));
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export {

export { derivedStream } from './derivedStream';

export { combineLatest, merge, zip } from './decoratedObservableCombiners';

export { persistentReducedStream } from './persistentReducedStream';
export { ObservableState } from './observableState';

Expand Down
14 changes: 0 additions & 14 deletions src/internal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,3 @@ export { RoutineFunc } from './routineFunc';
export { coldMergeOperators } from '../operators/mergeOperators';
export { defaultErrorSubject } from './defaultErrorSubject';
export { rethrowErrorGlobally } from './rethrowErrorGlobally';
export {
actionMarker,
markName,
markOfType,
markCombineLatest,
markWithLatestFrom,
markMerge,
markZip,
MarkedObservable,
findMarker,
Marker,
MarkerInterface,
MarkerType,
} from './markers';
Loading

0 comments on commit fcfce5c

Please sign in to comment.