@profiscience/knockout-contrib-observable-fn-subscribe-once
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-alpha.8 • Public • Published

@profiscience/knockout-contrib-observable-fn-subscribe-once

Version Dependency Status Peer Dependency Status Dev Dependency Status Downloads

NOTE: It is recommended to use the @profiscience/knockout-contrib-observable-fn metapackage

Creates a subscription that is called once and then disposed.

Usage

observable.fn.subscribeOnce(fn: (newValue: T) => void)

import '@profiscience/knockout-contrib-observable-fn/subscribeOnce'

const foo = ko.observable(0)

foo.subscribeOnce(() => console.log('hit!'))

foo(1)
// hit!

foo(2)
// nothing...

Dependents (1)

Package Sidebar

Install

npm i @profiscience/knockout-contrib-observable-fn-subscribe-once

Weekly Downloads

1

Version

1.0.0-alpha.8

License

WTFPL

Unpacked Size

6.45 kB

Total Files

10

Last publish

Collaborators

  • dorgeron
  • barsh