Add a base class for Spina-based components.

Review Request #13588 — Created Feb. 28, 2024 and submitted — Latest diff uploaded

Information

Ink
master

Reviewers

This introduces BaseComponentView, which is a Spina base class that
makes it easy to write components. It subclasses BaseView and provides
formal support for:

  1. Capturing initial construction state (options, whether a component
    was instantiated via crafting, and storage of children and
    subcomponents).

  2. Rendering management that tears down the initial state post-render.

  3. Utilities for storing subcomponent children when crafting (though
    this is subject to change in the future).

All Ink components will derive from this class.

Unit tests pass.

Made use of this in the development of new components.

Diff Revision 2 (Latest)

orig
1
2

Commits

First Last Summary ID Author
Add a base class for Spina-based components.
This introduces `BaseComponentView`, which is a Spina base class that makes it easy to write components. It subclasses `BaseView` and provides formal support for: 1. Capturing initial construction state (options, whether a component was instantiated via crafting, and storage of children and subcomponents). 2. Rendering management that tears down the initial state post-render. 3. Utilities for storing subcomponent children when crafting (though this is subject to change in the future). All Ink components will derive from this class.
1d8d1b9a9f1ef2bd21952006a061fd40cd1592a8 Christian Hammond
src/ink/js/components/views/baseComponentView.ts
src/ink/js/components/views/index.ts
src/ink/js/components/views/tests/baseComponentViewTests.ts
Loading...