This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ADD_ITEM = 'ADD_ITEM' | |
function addItem (item) { | |
return {type: ADD_ITEM, payload: item} | |
} | |
function Items ({items, onClick}) { | |
return ( | |
<div> | |
<ul> | |
{items.map((item) => <li>{item}</li>)} | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connect({ | |
items: state`items`, | |
itemAdded: signal`itemAdded` | |
}, | |
function Items ({items, itemAdded}) { | |
return ( | |
<div> | |
<ul> | |
{items.map((item) => <li>{item}</li>)} | |
</ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const qsort = (arr) => { | |
if (arr.length < 2) { | |
return arr; | |
} else { | |
// Опорная точка для деления массива, выбирается случайно | |
const pivotPosition = Math.floor(Math.random() * arr.length); | |
const pivot = arr[pivotPosition]; | |
// Значения меньшие, либо равные опорному | |
// попадают в новый массив less | |
const less = arr.filter((value, index) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const N = 10000; | |
let prev1, prev2, prev3, prev4; | |
let counter1 = 0, counter2 = 0, counter3 = 0, counter4 = 0; | |
function test(obj) { | |
if (!prev1) { | |
prev1 = obj; | |
} | |
if (!%HaveSameMap(prev1, obj)) { |
OlderNewer