Knockout typescript extenders

后端 未结 2 1807
傲寒
傲寒 2021-01-19 22:12

Could anyone please post an example of extending an observable in knockout in typescript? Knockout extender: http://knockoutjs.com/documentation/extenders.html

I am

2条回答
  •  生来不讨喜
    2021-01-19 22:48

    Update based on comment: In that case you just need to extend the interface separately to the definition file:

    interface KnockoutExtenders {
        logChange: (target: KnockoutObservableAny, option: string) => KnockoutObservableAny;
    }
    

提交回复
热议问题