knue
v1.0.0-alpha.3
Published
Drop-in replacement for much of the Knockout API, but backed with Vue.
Downloads
5
Readme
Knue - Knockout, powered by Vue
(WARNING: Not production ready, still in alpha. Open issues if you have a particular Knockout API you need.)
Drop-in replacement for much of the Knockout API, but backed with Vue. Useful for migrating from a Knockout codebase when refactoring to Vue.
ko
Root object
import Knue from 'knue'
const ko = new Knue()
API
Observable
const ko = new Knue()
const foo = ko.observable(1)
Or, methods can be destructured, like:
const { observable } = new Knue()
const foo = observable(1)
ObservableArray
const foo = ko.observableArray<string>()
console.log(foo()) // []
Computed
const co1 = ko.computed(() => 1)
const co2 = computed(() => co1() + 1)
console.log(co1()) // 1
console.log(co2()) // 2