Skip to content

8.0.0

Choose a tag to compare

@github-actions github-actions released this 01 Sep 12:49
5003e17

Major Changes

  • #24 16d7a26 Thanks @js2me! - removed all marked as deprecation properties and methods

    • Removed config property in ViewModelParams interface (renamed to vmConfig)
    • Removed linkStore method in ViewModelSimple interface (renamed to attachViewModelStore)
    • Removed type ComponentWithLazyViewModel (renamed to VMLazyComponent)
    • Removed type ComponentWithViewModel (renamed to VMComponent)
    • Removed params property in ViewModelBase class (renamed to vmParams)
  • #24 16d7a26 Thanks @js2me! - modified global payload processing

    Previosly viewModelsConfig haved the following configuration:

      comparePayload: 'strict',
      payloadObservable: 'ref',
      payloadComputed: false,

    So it was a bit performance overhead. Now it is:

      comparePayload: false,
      payloadComputed: 'struct',
      payloadObservable: 'ref',

Minor Changes

  • #24 16d7a26 Thanks @js2me! - added default implementation for generateId property in global viewModelsConfig

  • #24 16d7a26 Thanks @js2me! - id property now is optional for implementation for ViewModelSimple interface

    Now you can do not implement ViewModelSimple interface to work with this library:

    class MyVM {
      bar = '1'
    }
    ...
    const model = useCreateViewModel(MyVM);
    return <div>{model.bar}</div>;
    class MyVM {
      foo = '1';
    }
    ...
    const YouComponent = withViewModel(MyVM, ({ model }) => {
      return <div>{model.foo}</div>
    });
  • #24 16d7a26 Thanks @js2me! - parentViewModel property for ViewModelSimple interface

Patch Changes

  • #24 16d7a26 Thanks @js2me! - fixed typings for ParentViewModel generic type argument for all interfaces/classes (support AnyViewModelSimple)

Changes: 7.2.0...8.0.0