Ссылки на материалы, позволяющее лучше понять оригинальную идею.
Java and C++ make you think that the new ideas are like the old ones. Java is the most distressing thing to hit computing since MS-DOS.
Alan Kay
[ | |
["effector/effector", 3062], | |
["artalar/reatom", 566], | |
["dai-shi/will-this-react-global-state-work-in-concurrent-mode", 263], | |
["howtocards/frontend", 191], | |
["goupaz/goupaz.com", 163], | |
["mg901/effector-react-realworld-example-app", 119], | |
["goodmind/treact", 110], | |
["effector/patronum", 104], | |
["Nitrino/easysubs", 103], |
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
import { Effect, Event, sample, Store, Unit } from "effector" | |
declare let unit: Unit<number> | |
declare let store: Store<number> | |
declare let event: Event<number> | |
declare let effect: Effect<number, number> | |
store = sample(store) | |
store = sample(store, store) | |
event = sample(store, event) |
Effector is a brand new reactive state manager. Its ambitious team aims to solve all the problems that existing solutions have. Writing the core of the library from scratch took several attempts across six months, and recently the team released the first stable release.
In this article, I will show why I prefer using Effector for my new projects instead of other state managers. Let's get started with the Effector API.
Effector uses two concepts you might already be familiar with: store and event.
A store is an object that holds some value. We can create stores with the createStore
helper:
import {createStore} from 'effector'
This week NN Group released a video by Jakob Nielsen in which he attempts to help designers deal with the problem of customers being resistant to their new site/product redesign. The argument goes thusly:
There's slightly more to it than that, he caveats his argument with requiring you to have of course followed their best practices on product design, and allows for a period of customers being able to elect to continue to use the old site, although he says this is obviously only a temporary solution as you don't want to support both.
const createLogger = (backgroundColor, color) => { | |
const logger = (message, ...args) => { | |
if (logger.enabled === false) { | |
return; | |
} | |
console.groupCollapsed( | |
`%c${message}`, | |
`background-color: ${backgroundColor}; color: ${color}; padding: 2px 4px;`, | |
...args |
let str = ReasonReact.string; | |
let url = "http://localhost:3000/users"; | |
type user = { | |
id: int, | |
name: string, | |
}; | |
type state = |
let str = ReasonReact.string; | |
let el = ReasonReact.element; | |
let arr = ReasonReact.array; | |
module Dashboard = { | |
let component = ReasonReact.statelessComponent("Dashboard"); | |
let make = _children => { | |
...component, |