Domma Reactive User Manual

Coming from Knockout

Updated by Darryl Waterhouse on 17 October 2026 2 min read

The concepts map closely; the spellings do not. Nothing here is a drop-in replacement, and the differences are deliberate rather than incidental.

State and the graph

Knockout domma-reactive
ko.observable(1) - read o(), write o(2) observable(1) - read o.value, write o.value = 2
ko.observableArray([]) observableArray([]) - remove() takes a value or a test, as Knockout's does
.push .pop .shift .unshift .splice .sort .reverse identical
.remove .removeAll .indexOf .replace .destroy .destroyAll identical
ko.computed(fn) / ko.pureComputed(fn) computed(fn) - always lazy
ko.computed({read, write}) computed({read, write})
.extend({rateLimit: 300}) .extend({rateLimit: 300}) - also throttle, notify: 'always'
ko.extenders.mine = … registerExtender('mine', fn)
o.peek() o.peek()
ko.ignoreDependencies(fn) untracked(fn)
sub.dispose() off() or off.dispose()
ko.utils.unwrapObservable(x) none - read .value explicitly

Bindings

Knockout domma-reactive
text: name data-bind-text="name"
css: {on: isActive} data-bind-class="isActive && 'on'"
style: {color: shade} data-bind-style-color="shade", or data-bind-style="look"
attr: {href: url} data-bind-href="url"
value: query / textInput: query data-model="query"
checked: done data-model="done"
enable: x / disable: x data-bind-disabled="!x" / data-bind-disabled="x"
visible: x data-bind-hidden="!x"
hasFocus: editing data-focus="editing"
options: xs, optionsText: 'name' data-options="xs" data-options-text="name"
selectedOptions: chosen data-model="chosen" on a <select multiple>
click: save / event: {…} data-on-click="save" / data-on-<event>
if: isOpen / ifnot: isOpen data-if="isOpen" / data-if="!isOpen"
foreach: rows data-each="rows key=id", or {{#each rows key=id}}
with: obj {{#with obj}}
<!-- ko if: x --> … <!-- /ko --> <!-- dm if: x --> … <!-- /dm -->
ko.bindingHandlers.mine = … registerBinding('mine', handler)
ko.applyBindings(vm, el) applyBindings(vm, el)
ko.cleanNode(el) handle.dispose()
$data $root $parent $index identical
$parents[2] identical
$parentContext identical
$component identical
ko.components.register('x', …) registerComponent('x', {template, create})
component: {name: 'x', params: {a: b}} data-component="'x'" data-param-a="b"
component: {name: current} data-component="current.value" - swaps when it changes
params.a in a view model identical - and params is frozen
viewModel / createViewModel create(params, {element}) - one factory, no new
$componentTemplateNodes {{#slot}} in the template, data-slot at the usage site
html: markup none - {{{triple-stache}}}, which says so where you can see it

The four differences worth knowing before you start:

  • Reads are properties, not calls. o.value, never o(). That is what lets a template read an observable at all, since the expression language refuses method calls.
  • key= is how lists reconcile. Knockout's foreach diffs by identity automatically; here you name the key, and data-each insists on one.
  • No unsafe-eval required. Knockout compiles binding strings with the Function constructor, which a strict Content Security Policy blocks outright. This parses them instead. Plain object literals parse ({color: shade}), but style and options are still spelled with companion attributes, which read more clearly one property at a time.
  • An observable is not its value. Knockout unwraps if: show; here data-if="show" names the observable object, so it warns and fails closed. Write show.value.