HTTP REQUEST 的成本比 FILE SYSTEM REUEST 還貴 除了 JS 這種 compile 成本超高的外,其他的資源應該盡可能減少 request 數量。
由於 SVG 裡面其實是可以塞 script 進去,拿得到 cookie,會有一些神奇的安全性問題,所以最後 asset 類型的東西盡量放不同域名。
Machine({ | |
id: 'stubborn', | |
initial: 'inactive', | |
states: { | |
inactive: { | |
on: { | |
TOGGLE: { | |
target: 'active', | |
// send the TOGGLE event again to the service | |
actions: send('TOOGLE') |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) |
Machine({ | |
"id": "Team Member Status", | |
"initial": "invited", | |
"context": { | |
"retries": 0 | |
}, | |
"states": { | |
"invited": { | |
"on": { | |
"ACCEPT": { |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
import React, { memo, useCallback } from 'react'; | |
import ChildComponent from './wherever/ChildComponent.js'; | |
const updateChild = (props, childId, changes) => { | |
props.onUpdate({ | |
type: 'childChanged', | |
childId: childId, | |
changes: changes, | |
}); | |
}; |
HTTP REQUEST 的成本比 FILE SYSTEM REUEST 還貴 除了 JS 這種 compile 成本超高的外,其他的資源應該盡可能減少 request 數量。
由於 SVG 裡面其實是可以塞 script 進去,拿得到 cookie,會有一些神奇的安全性問題,所以最後 asset 類型的東西盡量放不同域名。
class Brainfuck { | |
ptr: number = 0 | |
cmdPtr: number = 0 | |
data: number[] = [0] | |
output: any[] = [] | |
loops: number[] = [] | |
input: string; | |
arg: string; | |
argPtr: number = 0; |