Closed miniben-90 closed 10 months ago
Thread will be started and check every 100ms if window value has changed and call a function with information of current window.
100ms
subscribeActiveWindow
unsubscribeActiveWindow
unsubscribeAllActiveWindow
import { subscribeActiveWindow, unsubscribeActiveWindow, unsubscribeAllActiveWindow } from '@miniben90/x-win'; const a = subscribeActiveWindow(activeWindow => { console.log('test a', activeWindow); }); const b = subscribeActiveWindow(activeWindow => { console.log('test b', activeWindow); }); const c = subscribeActiveWindow(activeWindow => { console.log('test c', activeWindow); }); setTimeout(() => unsubscribeActiveWindow(c), 5000); setTimeout(() => unsubscribeAllActiveWindow(), 10000);
Work in progress...
Feature subscribe to any change of active window
Thread will be started and check every
100ms
if window value has changed and call a function with information of current window.subscribeActiveWindow
: Create a subscription with a callback functionunsubscribeActiveWindow
: Remove a specific subscriptionunsubscribeAllActiveWindow
: Remove all threadsExample
Work in progress...