Web LoomWeb.loom
34 packages · 10 published on npm

Business logic that survives
framework changes

MVVM is the architectural discipline. The browser is the platform. Web Loom packages give you clean, typed APIs over mature browser primitives — fetch, storage, routing, events — without heavy abstractions or framework lock-in. Your business logic runs anywhere.

The pattern

One ViewModel.
Every framework.

The ViewModel is plain TypeScript — no framework imports, no heavy runtime. Infrastructure packages sit directly on mature browser APIs: fetch for HTTP, localStorage for persistence, History API for routing. Typed interfaces over what the platform already provides — not replacements for it.

  • Modelowns data, calls browser APIs or your backend
  • ViewModelderives displayable state, exposes Commands
  • Viewsubscribes and renders — the only framework-specific code
Deep dive into core concepts
TaskListViewModel.ts
import { BaseViewModel, Command }
  from '@web-loom/mvvm-core';
import { map } from 'rxjs/operators';

export class TaskListViewModel
  extends BaseViewModel<TaskModel> {

  readonly fetchCommand =
    this.registerCommand(
      new Command(() => this.model.fetchAll())
    );

  readonly pendingCount$ =
    this.data$.pipe(
      map(tasks =>
        (tasks ?? []).filter(t => !t.done).length
      )
    );
}
Identical class in React, Vue, Angular, React Native

Platform-first

The browser has matured.
Web Loom works with it, not around it.

Every infrastructure package is a thin, typed wrapper over a stable browser primitive. No proprietary runtimes. No invented protocols. Full tree-shaking.

fetchhttp-core

Typed requests with interceptors and response mapping

localStoragestorage-core

Versioned, typed persistence with session and memory adapters

History APIrouter-core

Reactive navigation state over pushState and popstate

EventTargetevent-emitter-core

Strongly typed event emitter with automatic disposal

Compatibility

Works with every major framework

The ViewModel has no framework imports. Connecting it to a new framework means writing one thin subscription bridge — typically under 20 lines.

The author

Festus Yeboah

Framework Architect

Festus is a frontend architect who has spent years watching teams rewrite the same business logic every time the framework pendulum swings. Web Loom is his attempt to give the web the same architectural continuity that Android, iOS, and .NET have enjoyed for twenty years.

The project is open-source and driven by the conviction that the 80% of an application that is not rendering code should be portable, testable, and immune to framework churn.

Follow on GitHub

Ready to stop rewriting?

Install the core package and wire up your first ViewModel in minutes.

$npm install @web-loom/mvvm-core rxjs