First commit
This commit is contained in:
15
src/processors/pricing.js
Normal file
15
src/processors/pricing.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const strom = require("strom").strom();
|
||||
const pricing = require("../stores/pricing");
|
||||
|
||||
module.exports = function ({
|
||||
seed = undefined,
|
||||
pricingStore = pricing.global({ seed }),
|
||||
} = {}) {
|
||||
return strom.map(({ ticker, price }) => {
|
||||
if (price) {
|
||||
pricingStore.set(ticker, parseFloat(price));
|
||||
}
|
||||
console.log(`Pricing for ${ticker} set to ${pricingStore.get(ticker)}`);
|
||||
return;
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user