redux-dryer
Advanced tools
Comparing version 0.1.7 to 0.1.8
{ | ||
"name": "redux-dryer", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"description": "Redux utilities to keep your reducers small and DRY", | ||
@@ -28,3 +28,6 @@ "main": "dist/index.js", | ||
"babel-preset-env": "^1.6.1" | ||
}, | ||
"dependencies": { | ||
"lodash": "^4.17.5" | ||
} | ||
} |
@@ -55,2 +55,3 @@ # Redux-dryer | ||
const BitcoinActions = { | ||
fetchedBitcoin: () => {}, // event actions, without payload | ||
setAmount: (rate, balance) => ({ bitcoins: balance / rate }) | ||
@@ -69,6 +70,9 @@ }; | ||
export const toBTC = balance => dispatch => | ||
export const toBTC = balance => dispatch => | ||
fetch("https://api.coindesk.com/v1/bpi/currentprice.json") | ||
.then(r => r.json()) | ||
.then(json => dispatch(BitcoinActions.setAmount(getRate(json), balance))); | ||
.then(json => { | ||
dispatch(BitcoinActions.fetchedBitcoin()); | ||
dispatch(BitcoinActions.setAmount(getRate(json), balance)); | ||
}); | ||
``` | ||
@@ -75,0 +79,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89671
160
1
+ Addedlodash@^4.17.5
+ Addedlodash@4.17.21(transitive)