Skip to content

Commit

Permalink
fix(rstream): disable __State reverse enum lookups
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 8, 2019
1 parent 227be4b commit b238a3a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/rstream/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const enum State {
/**
* Reverse lookup for `State` enums
*/
export const __State = (<any>exports).State;
// export const __State = (<any>exports).State;

export type Fn<T> = (x: T) => void;

Expand Down
4 changes: 2 additions & 2 deletions packages/rstream/src/subs/resolve.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IID } from "@thi.ng/api";
import { __State, DEBUG, State } from "../api";
import { DEBUG, State } from "../api";
import { Subscription } from "../subscription";
import { nextID } from "../utils/idgen";

Expand Down Expand Up @@ -54,7 +54,7 @@ export class Resolver<T> extends Subscription<Promise<T>, T> {
this.done();
}
} else {
DEBUG && console.log(`resolved value in ${__State[this.state]} state (${x})`);
DEBUG && console.log(`resolved value in state ${this.state} (${x})`);
}
},
(e) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/rstream/src/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
unreduced
} from "@thi.ng/transducers";
import {
__State,
DEBUG,
ISubscribable,
ISubscriber,
Expand Down Expand Up @@ -299,7 +298,7 @@ export class Subscription<A, B> implements

protected ensureState() {
if (this.state >= State.DONE) {
illegalState(`operation not allowed in ${__State[this.state]} state`);
illegalState(`operation not allowed in state ${this.state}`);
}
}

Expand Down

0 comments on commit b238a3a

Please sign in to comment.