└── README.md /README.md: -------------------------------------------------------------------------------- 1 | import { createEvent, createStore } from 'effector' 2 | 3 | const $count = createStore(0) 4 | 5 | const increment = createEvent('increment') 6 | 7 | $count.on(increment, (count) => count + 1) 8 | 9 | $count.watch((count) => { 10 | console.log(`count is ${count}`) 11 | }) // count is 0 (полезно для первичного рендера) 12 | 13 | increment() // count is 1 14 | increment() // count is 2 15 | /* 16 | * Фикс юникода в CMD 17 | * Просто импортируйте этот файл. 18 | * https://t.me/supapro/1129630 19 | */ 20 | #if defined(_WIN32) || defined(_WIN64) 21 | #pragma execution_character_set("utf-8") 22 | #include 23 | const auto _dummy_ = []() { 24 | SetConsoleCP(65001); 25 | SetConsoleOutputCP(65001); 26 | return 0; 27 | }(); 28 | #endif 29 | / 30 | //// 31 | . 32 | 33 | .. 34 | . 35 | --------------------------------------------------------------------------------