From d594d02c31305857f0b537014d1a8d9378b942f8 Mon Sep 17 00:00:00 2001 From: Jichao Ouyang Date: Thu, 1 Feb 2018 22:23:37 +1100 Subject: [PATCH] update peer and optional deps --- package.json | 12 ++-- src/fantasy/fantasyx.ts | 127 ---------------------------------------- 2 files changed, 7 insertions(+), 132 deletions(-) diff --git a/package.json b/package.json index fd318b4..16d6407 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xreact", - "version": "5.0.0", + "version": "5.0.1", "description": "Functional Reactive State Container for React", "repository": { "type": "git", @@ -29,10 +29,12 @@ "reflect-metadata": "^0.1.12" }, "peerDependencies": { - "@reactivex/rxjs": "^5.4.0", - "most": "^1.2.2", - "most-subject": "^5.3.0", - "react": "^15.5.4" + "react": "^16.2.0" + }, + "optionalDependencies": { + "@reactivex/rxjs": "^5.5.6", + "most": "^1.7.2", + "most-subject": "^5.3.0" }, "devDependencies": { "@reactivex/rxjs": "^5.5.6", diff --git a/src/fantasy/fantasyx.ts b/src/fantasy/fantasyx.ts index ef9ec4f..457dfa2 100644 --- a/src/fantasy/fantasyx.ts +++ b/src/fantasy/fantasyx.ts @@ -83,133 +83,6 @@ export class FantasyX { ), fB.plan) ), this.plan)) } - // patch(f: (a: A) => Partial = _ => _): FantasyX { - // return new FantasyX(intent$ => { - // let machine = this.plan(intent$) - // let update$ = streamOps.map, State>( - // state => state.patch(f), - // machine.update$ - // ) - // return { update$, actions: machine.actions } - // }) - // } - - // bimap( - // fa: (b?: Actions) => Actions, fb: (a: A) => B - // ): FantasyX { - // return new FantasyX(intent$ => { - // let machine = this.plan(intent$) - // let update$ = streamOps.map, State>( - // state => state.map(fb), - // machine.update$ - // ) - // return { update$, actions: fa(machine.actions) } - // }) - // } - - // combine3( - // f: (a: A, b: B, c: C) => D, - // planB: FantasyX, - // planC: FantasyX - // ): FantasyX { - // return new FantasyX(intent$ => { - // let machineB = planB.plan(intent$), - // machineA = this.plan(intent$), - // machineC = planC.plan(intent$); - // let update$ = streamOps.combine, State, State, State>( - // (S1, S2, S3) => - // S1.chain(s1 => - // S2.chain(s2 => - // S3.chain(s3 => - // State.pure(f(s1, s2, s3))))) - // , machineA.update$, machineB.update$, machineC.update$ - // ) - // let actions = Object.assign({}, machineA.actions, machineB.actions, machineC.actions) - // return { update$, actions } - // }) - // } - - // combine4( - // f: (a: A, b: B, c: C, d: D) => F, - // planB: FantasyX, - // planC: FantasyX, - // planD: FantasyX - // ): FantasyX { - // return new FantasyX(intent$ => { - // let machineB = planB.plan(intent$), - // machineA = this.plan(intent$), - // machineC = planC.plan(intent$), - // machineD = planD.plan(intent$) - // ; - // let update$ = streamOps.combine, State, State, State, State>( - // (S1, S2, S3, S4) => - // S1.chain(s1 => - // S2.chain(s2 => - // S3.chain(s3 => - // S4.chain(s4 => - // State.pure(f(s1, s2, s3, s4)))))) - // , machineA.update$, machineB.update$, machineC.update$, machineD.update$ - // ) - // let actions = Object.assign({}, machineA.actions, machineB.actions, machineC.actions, machineD.actions) - // return { update$, actions } - // }) - // } - - // combine5( - // f: (a: A, b: B, c: C, d: D, e: F) => G, - // planB: FantasyX, - // planC: FantasyX, - // planD: FantasyX, - // planE: FantasyX - // ): FantasyX { - // return new FantasyX(intent$ => { - // let machineB = planB.plan(intent$), - // machineA = this.plan(intent$), - // machineC = planC.plan(intent$), - // machineD = planD.plan(intent$), - // machineE = planE.plan(intent$) - // ; - // let update$ = streamOps.combine, State, State, State, State, State>( - // (S1, S2, S3, S4, S5) => - // S1.chain(s1 => - // S2.chain(s2 => - // S3.chain(s3 => - // S4.chain(s4 => - // S5.chain(s5 => - // State.pure(f(s1, s2, s3, s4, s5))))))) - // , machineA.update$, machineB.update$, machineC.update$, machineD.update$, machineE.update$ - // ) - // let actions = Object.assign({}, machineA.actions, machineB.actions, machineC.actions, machineD.actions, machineE.actions) - // return { update$, actions } - // }) - // } - - - // concat( - // fa: FantasyX - // ): FantasyX { - // return this.combine((a, b) => { - // if (isSemigroup(a) && isSemigroup(b)) - // return a.concat(b) - // else - // return b - // }, fa) - // } - - // merge( - // fa: FantasyX - // ): FantasyX { - // return new FantasyX(intent$ => { - // let machineA = this.plan(intent$) - // let machineB = fa.plan(intent$) - // let update$ = streamOps.merge>( - // machineA.update$, - // machineB.update$ - // ) - // return { update$, actions: Object.assign({}, machineA.actions, machineB.actions) } - // }) - // } - } declare module './typeclasses' {