🔗 Property Delegation (by)
Operator by deleguje właściwość do specjalnego handlera.
lazy - leniwa inicjalizacja
let config by lazy {
print("Ładowanie konfiguracji...");
{host: "localhost", port: 8080}
};
print(config.host);
print(config.port);
observable - reaktywne wartości
let counter by observable(0);
fn onChange(newVal, oldVal) {
print(`Zmiana: ${oldVal} -> ${newVal}`);
}
counter.subscribe(onChange);
counter.setValue(5);
counter.setValue(10);
print(counter.getValue());