Documentation
    Preparing search index...

    Function createWmService

    • Create a WM service. If strategy is omitted, a no-op identity strategy is used (returns windows unchanged) — consumers can ship a working shell before implementing a concrete layout.

      The strategy is closure-scoped. Consumers invoke strategy.arrange(windows, containerRect) from their own event handlers using state snapshots. This factory does NOT call arrange() internally; only consumers know when a re-layout is appropriate.

      Parameters

      Returns WmService

      import { createWmService } from '@kehto/wm';
      import { masterStackStrategy } from './strategies/master-stack';

      const wm = createWmService({
      hooks: { selectLayout(){}, onWindowCreated(){}, onWindowDestroyed(){}, onWindowMoved(){} },
      strategy: masterStackStrategy, // omit to use no-op default
      });