Skip to content

Commit

Permalink
fixed some babel and typescript compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mweststrate committed Mar 1, 2017
1 parent 218e3b4 commit c662fac
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/api/autorun.ts
Expand Up @@ -197,7 +197,7 @@ export function reaction<T>(expression: (r: IReactionPublic) => T, effect: (arg:
let nextValue: T;

const r = new Reaction(opts.name, () => {
if (opts.delay < 1) {
if ((opts.delay as any) < 1) {
reactionRunner();
} else if (!isScheduled) {
isScheduled = true;
Expand Down
2 changes: 1 addition & 1 deletion src/types/observablevalue.ts
Expand Up @@ -127,4 +127,4 @@ export class ObservableValue<T> extends BaseAtom implements IObservableValue<T>,

ObservableValue.prototype[primitiveSymbol()] = ObservableValue.prototype.valueOf;

export const isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue);
export var isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue) as (x: any) => x is IObservableValue<any>;
2 changes: 1 addition & 1 deletion src/utils/decorators.ts
Expand Up @@ -28,7 +28,7 @@ export function createClassPropertyDecorator(
*/
allowCustomArguments: boolean
): any {
function classPropertyDecorator(target: any, key: string, descriptor, customArgs?: IArguments, argLen?: number) {
function classPropertyDecorator(target: any, key: string, descriptor, customArgs?: IArguments, argLen: number = 0) {
invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator");
if (!descriptor) {
// typescript (except for getter / setters)
Expand Down
8 changes: 4 additions & 4 deletions test/babel/babel-tests.js
@@ -1,8 +1,8 @@
import {
observable, computed, transaction, autorun, extendObservable, action,
isObservableObject, observe, isObservable, spy, isAction,
default as mobx
isObservableObject, observe, isObservable, spy, isAction, useStrict
} from "../";
import * as mobx from "../"

var test = require('tape')

Expand Down Expand Up @@ -334,13 +334,13 @@ test("custom action decorator on field (babel)", function(t) {
});

test("267 (babel) should be possible to declare properties observable outside strict mode", t => {
mobx.useStrict(true);
useStrict(true);

class Store {
@observable timer;
}

mobx.useStrict(false);
useStrict(false);
t.end();
})

Expand Down

0 comments on commit c662fac

Please sign in to comment.