donejs / done-component

A plugin for creating <can-component>s
https://www.npmjs.com/package/done-component
MIT License
8 stars 2 forks source link

Fix the viewModel -> ViewModel warning #73

Closed chasenlehara closed 6 years ago

chasenlehara commented 6 years ago

This fixes a warning from can-component about assigning a DefineMap to the viewModel instead of ViewModel (capital V).

Warnings shown when running the tests before this change: before

After this change: after

Fixes https://github.com/donejs/done-component/issues/58

matthewp commented 6 years ago

lgtm

bmomberger-bitovi commented 6 years ago

@chasenlehara what happens now when you export a plain object from the view-model script? Is there a different warning? does it still work as intended (extending types.DefaultMap)?

chasenlehara commented 6 years ago

Providing a plain object as the ViewModel works, but I have a PR to deprecate it in can-component 3 because the default changes in 4.0 and I don’t think we want people relying on it being a specific type anymore.