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
Предполагаю, должно быть так: | |
Есть компонент списка - presentational. Получает на вход список. Получает на вход ссылку на обработчик события select-же. | |
Есть компонент товара - presentational. Получает на вход товар. Получает на вход ссылку на обработчик нажатия на сохранить. | |
Есть компонент контейнер: встраивает в себя список и товар. Как раз этот компонент несёт в себе логику списка + страницы товара. | |
Контейнер по инициализации посылает событие на получение списка товаров. Слушает изменение списка тоже он. По изменению обновляет пропс в компоненте списка. | |
Он же по изменению в сторе выбранного товара обновляет пропс в товаре. | |
Он же прокидывает в пропсы компонентов обработчики сохранения и выбора элемента. |
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
Есть стор. Очевидно нужен ngrx/side-effects (для запросов). | |
При загрузке компонента список диспатчим событие на загрузку списка. Список загружается, стор обновляется. | |
В компоненте же слушаем обновление стора. Когда обновляется список, если не было последнего выбранного, то выбираем первый элемент. | |
По выбору элемента диспатчим action SELECT_GOOD. Сэтится новое значение в сторе. | |
Компонент с данными по товару слушает стор на предмет обновления выбранного события. | |
По нажатию на кнопку сохранить диспатчим событие сохранить данные. | |
???? Компонент списка по этому событию обновляет список. Выбирается на этот раз выбранный в предыдущий раз компонент. | |
__Получается нажатие на кнопку диспатчит одно событие, компонент списка его ловит и посылает своё событие? Надо разобраться.__ |
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
{"lastUpload":"2017-05-14T16:17:40.937Z","extensionVersion":"v2.7.0"} |
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
<html> | |
<head> | |
<title>Test</title> | |
</head> | |
<body> | |
Test iterator | |
<script> | |
const gen = function* () { |
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
var testSize = 10000; | |
prepare(); | |
runTest(); | |
function prepare () { | |
window.arr = []; | |
for (var i = 0; i < 1000; i++) window.arr[i] = 0; | |
} |
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
Test md | |
--- |
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
<!DOCTYPE html> | |
<html > | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<meta content='width=1024' name='viewport'> | |
<title>Новый топик / Хабрахабр</title> | |
<meta name='yandex-verification' content='67d46b975fa41645' /> <!-- яндекс вебмастер - верификация --> |
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
SELECT | |
c.id, | |
s.name as supplierName, | |
s.id as supplierId, | |
c.conclusionDate, | |
ADDDATE(c.conclusionDate INTERVAL c.period YEAR) as cancelDate, | |
c.period | |
FROM | |
Contracts as c | |
INNER JOIN |
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
<? | |
$breadcrumbs->add(new Breadcrumb("/clients/orders", "Заказы")); | |
$subaction = isset($_GET['subaction']) ? $_GET['subaction'] : null; | |
switch($subaction): | |
default: | |
$MAIN_OUTPUT .= "<h3>Стандартная страница раздела Клиенты -> Заказы</h3>"; | |
break; | |
case "add": | |
$breadcrumbs->add(new Breadcrumb("/client/orders/add", "Добавление")); |
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
function alphabeta(node, depth, alpha, beta, isMax, g) { | |
g.nodes[node.name].shape.items['0'].attr('fill', 'green'); | |
if((depth == 0) || (node.isTerminal == true)) { | |
console.log('getting value from terminal node '+node.name+' (value is '+node.value+')'); | |
return node.value; | |
} | |
if(isMax) { | |
console.log('maximizing ('+node.name+')'); |