MCPcopy
hub / github.com/getify/Functional-Light-JS / updateStockElems

Function updateStockElems

ch11-code/stock-ticker.js:5–23  ·  view source on GitHub ↗
(stockInfoChildElemList,data)

Source from the content-addressed store, hash-verified

3var stockTickerUI = {
4
5 updateStockElems(stockInfoChildElemList,data) {
6 var getDataVal = curry( reverseArgs( prop ), 2 )( data );
7 var extractInfoChildElemVal = pipe(
8 getClassName,
9 curry( stripPrefix )( /\bstock-/i ),
10 getDataVal
11 );
12 var orderedDataVals =
13 map( extractInfoChildElemVal )( stockInfoChildElemList );
14 var elemsValsTuples =
15 filterOut( function updateValueMissing([infoChildElem,val]){
16 return val === undefined;
17 } )
18 ( zip( stockInfoChildElemList, orderedDataVals ) );
19
20 // !!SIDE EFFECTS!!
21 compose( each, spreadArgs )( setDOMContent )
22 ( elemsValsTuples );
23 },
24
25 updateStock(tickerElem,data) {
26 var getStockElemFromId = curry( getStockElem )( tickerElem );

Callers

nothing calls this directly

Calls 5

curryFunction · 0.85
reverseArgsFunction · 0.85
filterOutFunction · 0.85
zipFunction · 0.85
composeFunction · 0.85

Tested by

no test coverage detected