js-awe
Advanced tools
Comparing version 1.0.32 to 1.0.33
{ | ||
"name": "js-awe", | ||
"version": "1.0.32", | ||
"version": "1.0.33", | ||
"homepage": "https://github.com/josuamanuel/js-awe", | ||
@@ -5,0 +5,0 @@ "author": "josuamanuel@hotmail.com", |
@@ -13,3 +13,3 @@ # js-awe | ||
One problem I see, is the spread of async await around the source code wherever it is handy. Every time we use await, an async branch will be created. The result will be an execution flow with the shape of a tree, with some chain functions running in sequence and others running concurrently. Understanding the tree of execution flow turns difficult. This is mainly by the fact that the construct of the tree is not explicitly coded in one place. | ||
One problem I see, is the spread of casual async await around the source code wherever it is handy. Every time we use await, an async branch will be created. The result will be an execution flow with the shape of a tree, with some chain functions running in sequence and others running concurrently. Understanding the tree of execution flow turns difficult. This is mainly by the fact that the construct of the tree is not explicitly coded in one place. | ||
@@ -118,3 +118,3 @@ js-awe library has a “plan” function that can help you with that. | ||
the Plan utility is recommended when we have a complex tree, and you want to manifest explicitly this async flow. For example, This utility would be a good tool for an API that generates its response based on different calls to other APIS. Especially if some of the calls need to be called in sequence and others can be run concurrently. | ||
The Plan utility is recommended when we have a complex tree, and you want to manifest explicitly this async flow. For example, This utility would be a good tool for an API that generates its response based on different calls to other APIS. Especially if some of the calls need to be called in sequence and others can be run concurrently. | ||
@@ -132,3 +132,3 @@ When it is not recommended: | ||
```logs | ||
```Plaintext | ||
chronoCreation : 2023-05-25T20:58:17.175Z | ||
@@ -162,3 +162,3 @@ report : 2023-05-25T20:58:18.480Z | ||
│ 2 │ [ 'step2', 'step3' ] │ 501 │ 39.58 │ | ||
└─────────┴──────────────────────┴──────────┴───── | ||
└─────────┴──────────────────────┴──────────┴────────────┘ | ||
``` | ||
@@ -165,0 +165,0 @@ |
import { arraySorter, pushUniqueKeyOrChange, sorterByPaths, pushUniqueKey, CustomError, pushAt } from './jsUtils.js'; | ||
import { groupByWithCalc} from './ramdaExt.js'; | ||
import pipe from 'ramda/src/pipe' | ||
import map from 'ramda/src/map' | ||
import sort from 'ramda/src/sort' | ||
import { groupByWithCalc, R} from './ramdaExt.js'; | ||
@@ -303,5 +300,4 @@ import { Table, consoleTable } from './table/table.js' | ||
console.log('Total elapse Time of each event: ') | ||
consoleTable(toLog) | ||
return events | ||
@@ -312,3 +308,3 @@ } | ||
pipe( | ||
R.pipe( | ||
groupByWithCalc( | ||
@@ -318,3 +314,3 @@ (row) => JSON.stringify(row.runningEvents.sort(arraySorter())), | ||
), | ||
map(row => ({ ...row, elapseMs: Math.floor(row.elapseMs), percentage: Number(row.percentage.toFixed(2)) })), | ||
R.map(row => ({ ...row, elapseMs: Math.floor(row.elapseMs), percentage: Number(row.percentage.toFixed(2)) })), | ||
(coincidingEvents) => { | ||
@@ -367,3 +363,3 @@ console.log('') | ||
chronoReport() | ||
pipe( | ||
R.pipe( | ||
//RE.RLog('0-->: '), | ||
@@ -378,3 +374,3 @@ formatReportAndReturnInputParam, | ||
//RE.RLog('3-->: '), | ||
sort(sorterByPaths('range.start')), | ||
R.sort(sorterByPaths('range.start')), | ||
reportListOfNameRanges, | ||
@@ -381,0 +377,0 @@ //RE.RLog('4-->: '), |
245352
75
7098