knockout-contrib

:metal: KnockoutJS Goodies Monorepo

View the Project on GitHub Profiscience/knockout-contrib

utils.toggle

Version Dependency Status Peer Dependency Status Dev Dependency Status Downloads

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

Toggles a boolean observable

Usage

import { toggle } from '@profiscience/knockout-contrib'

const foo = ko.observable(true)

toggle(foo) // false
toggle(foo) // true