Skip to content
Permalink
Browse files
fixed some babel and typescript compilation issues
  • Loading branch information
mweststrate committed Mar 1, 2017
1 parent 218e3b4 commit c662facef4970444c11fbf27e2a1296267159229
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
@@ -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;
@@ -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>;
@@ -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)
@@ -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')

@@ -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();
})

0 comments on commit c662fac

Please sign in to comment.