:metal: KnockoutJS Goodies Monorepo
This package is intended for consumption via the [@profiscience/knockout-contrib] metapackage.
Increments/decrements a numeric observable. Returns the new value.
import { increment, decrement } from '@profiscience/knockout-contrib'
const foo = ko.observable(0)
increment(foo) // 1
increment(foo, 3) // 4
decrement(foo) // 3
decrement(foo, 2) // 1