-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove default export in favour of named export
BREAKING CHANGE: There is no longer a default export. Use the named export instead, e.g. use `import {chain} from "@softwareventures/chain"` instead of `import chain from "@softwareventures/chain"`.
- Loading branch information
Showing
5 changed files
with
3 additions
and
102 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 |
---|---|---|
|
@@ -6,4 +6,3 @@ npm-debug.log | |
*.js | ||
*.d.ts | ||
*.js.map | ||
!/fix-types-for-back-compat.js |
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 |
---|---|---|
|
@@ -4,4 +4,3 @@ node_modules | |
*.d.ts | ||
*.js.map | ||
!/types/*.d.ts | ||
!/fix-types-for-back-compat.js |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,22 +1,13 @@ | ||
interface Chain<T> { | ||
export interface Chain<T> { | ||
readonly value: T; | ||
map: <U>(f: (x: T) => U) => Chain<U>; | ||
then: <U>(f: (x: T) => Chain<U>) => Chain<U>; | ||
} | ||
|
||
function chain<T>(x: T): Chain<T> { | ||
export function chain<T>(x: T): Chain<T> { | ||
return { | ||
value: x, | ||
map: f => chain(f(x)), | ||
then: f => f(x) | ||
}; | ||
} | ||
|
||
// For forward compatibility with v3.0 | ||
chain.chain = chain; | ||
|
||
/** @deprecated For backwards compatibility with versions < v1.0.1. | ||
* Will be removed in v3.0. */ | ||
chain.default = chain; | ||
|
||
export = chain; |
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