:metal: KnockoutJS Goodies Monorepo
This package is intended for consumption via the [@profiscience/knockout-contrib] metapackage
Creates a subscription that is called once and then disposed. Returns subscription for early disposal if necessary.
import { once } from '@profiscience/knockout-contrib'
const foo = ko.observable(0)
const sub = once(foo, () => console.log('hit!'))
foo(1)
// hit!
foo(2)
// nothing...