-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make .run method available everytime
.run method is available in both unapplied io and handler Closes #120
- Loading branch information
1 parent
e56900e
commit 3e31b51
Showing
5 changed files
with
34 additions
and
28 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
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
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 |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import ioRunner from './internal/ioRunner'; | ||
|
||
const createIo = (f, args) => { | ||
const createIo = (f, args = []) => { | ||
const ioObject = (...args) => createIo(f, args) | ||
ioObject.f = f; | ||
ioObject.args = args; | ||
if (args) { | ||
ioObject.run = (runner = ioRunner) => { | ||
return runner(ioObject) | ||
} | ||
ioObject.run = (runner = ioRunner) => { | ||
return runner(ioObject) | ||
} | ||
return ioObject; | ||
} | ||
|
||
export default (f) => createIo(f, null); | ||
export default (f) => createIo(f); |