In functional programming you often want to apply a function partly. A simple example is a function add
.
It would be nice if we could use add
like:
var res2 = add(1, 3); // => 4
var add10To = add(10);
var res = add10To(5); // => 15
(() => { | |
document.querySelector('[data-disable-with^=Loading]')?.click(); | |
setTimeout(() => document.querySelectorAll('.Details-content--closed').forEach(x => x.click()), 4000) | |
})() |
const machine = Machine({ | |
id: "machine", | |
initial: "A", | |
states: { | |
A: { | |
after: { | |
2_000: "B", | |
}, | |
}, | |
B: { |
const alivePing = Machine({ | |
id: "alivePing", | |
initial: "enabled", | |
states: { | |
enabled: { | |
on: { | |
DISABLE: "disabled", | |
ALIVE_PING: { | |
target: "enabled", | |
actions: actions.cancel("delay") |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |