Skip to content

Commit

Permalink
update some dev-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
xaviergonz committed Oct 13, 2019
1 parent 8fa8629 commit a37d378
Show file tree
Hide file tree
Showing 3 changed files with 862 additions and 866 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"mobx": "^5.5.0",
"prettier": "^1.7.2",
"rollup": "^0.50.0",
"rxjs": "^5.0.2",
"rxjs": "^6.0.0",
"shelljs": "^0.8.3",
"ts-jest": "^24.0.2",
"typescript": "*"
Expand Down
21 changes: 9 additions & 12 deletions test/observable-stream.js → test/observable-stream.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
"use strict"

const utils = require("../src/mobx-utils")
const mobx = require("mobx")
const Rx = require("rxjs")
import * as utils from "../src/mobx-utils"
import * as mobx from "mobx"
import {from, interval} from "rxjs"
import { map } from 'rxjs/operators';

test("to observable - should push the initial value by default", () => {
const user = mobx.observable({
Expand All @@ -14,9 +13,8 @@ test("to observable - should push the initial value by default", () => {

let values = []

const sub = Rx.Observable
.from(utils.toStream(() => user.firstName + user.lastName, true))
.map(x => x.toUpperCase())
const sub = from(utils.toStream(() => user.firstName + user.lastName, true)).pipe(
map(x => x.toUpperCase()))
.subscribe(v => values.push(v))

user.firstName = "John"
Expand All @@ -43,9 +41,8 @@ test("to observable - should not push the initial value", () => {

let values = []

const sub = Rx.Observable
.from(utils.toStream(() => user.firstName + user.lastName))
.map(x => x.toUpperCase())
const sub = from(utils.toStream(() => user.firstName + user.lastName)).pipe(
map(x => x.toUpperCase()))
.subscribe(v => values.push(v))

user.firstName = "John"
Expand All @@ -64,7 +61,7 @@ test("to observable - should not push the initial value", () => {

test("from observable", done => {
mobx.configure({ enforceActions: "observed" })
const fromStream = utils.fromStream(Rx.Observable.interval(10), -1)
const fromStream = utils.fromStream(interval(10), -1)
const values = []
const d = mobx.autorun(() => {
values.push(fromStream.current)
Expand Down
Loading

0 comments on commit a37d378

Please sign in to comment.