This repository has been archived by the owner on Feb 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
80kb module download instead of 4.8MB #18 Signed-off-by: Thibault Maekelbergh <thibault.maekelbergh@student.howest.be>
- Loading branch information
Thibault Maekelbergh
committed
Nov 21, 2016
1 parent
a74ec2f
commit 32d4715
Showing
8 changed files
with
36 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const statusResult = { | ||
name: `delivered`, | ||
status: `active`, | ||
label: { | ||
main: `pickedUp`, | ||
detail: `inPostPoint`, | ||
}, | ||
knownProcessStep: `PICKED_UP_IN_POST_POINT_INTERNATIONAL`, | ||
}; | ||
|
||
const composedFetch = id => { | ||
return new Promise((resolve, reject) => { | ||
process.nextTick(() => | ||
statusResult[status] === `active` | ||
? resolve(statusResult) | ||
: reject({ | ||
error: `no active step found for ${id}`, | ||
}) | ||
); | ||
}); | ||
}; | ||
|
||
export default composedFetch; |
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 |
---|---|---|
|
@@ -68,6 +68,6 @@ | |
}, | ||
"dependencies": { | ||
"axios": "^0.15.2", | ||
"lodash": "^4.17.2" | ||
"lodash.find": "^4.6.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
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