2.0.1 • Published 4 years ago

@profiscience/knockout-contrib-utils-increment v2.0.1

Weekly downloads
2
License
WTFPL
Repository
github
Last release
4 years ago

utils.increment / utils.decrement

Version Dependency Status Peer Dependency Status Dev Dependency Status Downloads

This package is intended for consumption via the @profiscience/knockout-contrib metapackage.

Increments/decrements a numeric observable. Returns the new value.

Usage

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