ts-sort-bubble
sync + callback + Promise + Async/Await style bubblesort implementation in typescript
Install
npm install ts-sort-bubble --save-devyarn add ts-sort-bubble -D
commonjs use [sync + callback + Promise + Async/Await]
var bubbleSort = bubbleSort; var bubbleSortSync = bubbleSortSync;console// output: [2,3, 4, 27, 57,100,343] var bubbleSortAsync = bubbleSortAsync; var bubbleSortAsyncW = bubbleSortAsync; { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]}
es6 use [sync + callback + Promise + Async Await]
console { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]}
umd web browser use [sync + callback + Promise + Async Await]
<script src="https://unpkg.com/ts-sort-bubble@1.0.1/umd/index.js"></script> tsSortBubble console tsSortBubble { var array4 = 3457210027343 var les = await tsSortBubble console // output: [2,3, 4, 27, 57,100,343]}
API
bubbleSortSync: (arr: number[]) => any;
bubbleSort: (arr: number[], callback: (data: number) => void) => any;
bubbleSortAsync: (arr: number[]) => any;
- arr - The array to sort in place
- callback - function to get sort array result