-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
70 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ node_modules/ | |
dist/ | ||
.*.swp | ||
yarn-error.log | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ | |
"version": "1.6.5", | ||
"description": "", | ||
"license": "MIT", | ||
"main": "lib/index.js", | ||
"typings": "lib/index.d.ts", | ||
"main": "dist/index.js", | ||
"typings": "dist/index.d.ts", | ||
"author": { | ||
"name": "Paul Gray", | ||
"email": "[email protected]", | ||
|
@@ -15,7 +15,7 @@ | |
"lint-fix": "tslint --project tsconfig-build.json --fix", | ||
"docs:gitbook": "gitbook build ./ docs", | ||
"docs:typedoc": "typedoc --module commonjs --out docs/typedoc/ src/", | ||
"build": "npm-run-all clean build:ts build:dist docs:gitbook", | ||
"build": "npm-run-all clean build:ts build:dist", | ||
"build:ts": "tsc -p tsconfig-build.json", | ||
"build:dist": "webpack --config webpack/bundle.ts", | ||
"clean": "rm -rf lib/", | ||
|
@@ -65,12 +65,15 @@ | |
"ts-node": "^3.3.0", | ||
"tslint": "^5.7.0", | ||
"typedoc": "^0.11.1", | ||
"typescript": "^2.5.3", | ||
"typescript": "^3.4.0", | ||
"webpack": "^4.0.0", | ||
"webpack-cli": "^3.0.3", | ||
"webpack-dev-server": "^3.1.4" | ||
}, | ||
"dependencies": {}, | ||
"dependencies": { | ||
"fp-ts": "^1.15.0", | ||
"fp-ts-contrib": "^0.0.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "^15.0.0 || ^16.0.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { Monad1 } from "fp-ts/lib/Monad"; | ||
import { HKT } from 'fp-ts/lib/HKT'; | ||
import { ChainableComponent } from ".."; | ||
import { Do } from 'fp-ts-contrib/lib/Do'; | ||
|
||
export const URI = "ChainableComponent"; | ||
export type URI = typeof URI; | ||
|
||
declare module "fp-ts/lib/HKT" { | ||
interface URI2HKT<A> { | ||
ChainableComponent: ChainableComponent<A>; | ||
} | ||
} | ||
|
||
export const chainableComponent: Monad1<URI> = { | ||
URI, | ||
of<A>(a: A) { | ||
return ChainableComponent.of(a); | ||
}, | ||
map<A, B>(fa: ChainableComponent<A>, f: (a: A) => B) { | ||
return fa.map(f); | ||
}, | ||
ap<A, B>(fab: ChainableComponent<(a: A) => B>, fa: ChainableComponent<A>) { | ||
return fa.ap(fab) | ||
}, | ||
chain<A, B>(fa: ChainableComponent<A>, f: (a: A) => ChainableComponent<B>) { | ||
return fa.chain(f) | ||
} | ||
}; | ||
|
||
export const DoBuilder = Do(chainableComponent) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,10 @@ | |
version "10.3.5" | ||
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.3.5.tgz#8423cdf6e6fb83433e489900d7600d3b61c8260c" | ||
|
||
"@types/prop-types@*": | ||
version "15.7.0" | ||
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.0.tgz#4c48fed958d6dcf9487195a0ef6456d5f6e0163a" | ||
|
||
"@types/ramda@^0.25.36": | ||
version "0.25.36" | ||
resolved "https://registry.yarnpkg.com/@types/ramda/-/ramda-0.25.36.tgz#1ddaf3211c7cd7046fcaefe68c713469ccfc9504" | ||
|
@@ -105,12 +109,19 @@ | |
"@types/history" "*" | ||
"@types/react" "*" | ||
|
||
"@types/react@*", "@types/react@^16.0.10": | ||
"@types/react@*": | ||
version "16.4.1" | ||
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.4.1.tgz#c53bbfb4a78933db587da085ac60dbf5fcf73f8f" | ||
dependencies: | ||
csstype "^2.2.0" | ||
|
||
"@types/react@^16.0.10": | ||
version "16.8.10" | ||
resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.10.tgz#1ccb6fde17f71a62ef055382ec68bdc379d4d8d9" | ||
dependencies: | ||
"@types/prop-types" "*" | ||
csstype "^2.2.0" | ||
|
||
"@types/recompose@^0.26.4": | ||
version "0.26.4" | ||
resolved "https://registry.yarnpkg.com/@types/recompose/-/recompose-0.26.4.tgz#93dd6c4e28857cd799e9a807a470f66a40c49c3f" | ||
|
@@ -2102,6 +2113,16 @@ forwarded@~0.1.2: | |
version "0.1.2" | ||
resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" | ||
|
||
fp-ts-contrib@^0.0.2: | ||
version "0.0.2" | ||
resolved "https://learningobjects.jfrog.io/learningobjects/api/npm/npm-virtual/fp-ts-contrib/-/fp-ts-contrib-0.0.2.tgz#95d3f5a3810020f8aea030bfcbd1efabbfb8124e" | ||
dependencies: | ||
fp-ts "^1.14.3" | ||
|
||
fp-ts@^1.14.3, fp-ts@^1.15.0: | ||
version "1.15.0" | ||
resolved "https://learningobjects.jfrog.io/learningobjects/api/npm/npm-virtual/fp-ts/-/fp-ts-1.15.0.tgz#7706d6761cc98ccbece91c2ff2e5a5b924f65f3d" | ||
|
||
fragment-cache@^0.2.1: | ||
version "0.2.1" | ||
resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" | ||
|
@@ -5540,9 +5561,9 @@ [email protected]: | |
version "2.7.2" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.2.tgz#2d615a1ef4aee4f574425cdff7026edf81919836" | ||
|
||
typescript@^2.5.3: | ||
version "2.9.2" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c" | ||
typescript@^3.4.0: | ||
version "3.4.1" | ||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.1.tgz#b6691be11a881ffa9a05765a205cb7383f3b63c6" | ||
|
||
ua-parser-js@^0.7.18: | ||
version "0.7.18" | ||
|