UNPKG

elliotisms

Version:

reusable atomic functions for the dumb shit i reuse all the time. only about half are jokes.

18 lines (14 loc) 418 B
import ObservableObject from './object-sync.js'; async function main() { const obj = new ObservableObject({ key1: 'value1' }); const observed = obj.observedObject; // Simulate changes observed.key2 = 'value2'; observed.key3 = 'value3'; observed.key1 = 'new value'; // Wait for changes to simulate a long-running process setTimeout(() => { observed.key4 = 'another value'; }, 5000); } main();