Add a base class for Spina-based components.
Review Request #13588 — Created Feb. 28, 2024 and submitted
This introduces
BaseComponentView
, which is a Spina base class that
makes it easy to write components. It subclassesBaseView
and provides
formal support for:
Capturing initial construction state (options, whether a component
was instantiated via crafting, and storage of children and
subcomponents).Rendering management that tears down the initial state post-render.
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.
-
-
src/ink/js/components/views/baseComponentView.ts (Diff revision 1) We generally are using
TOptions
instead ofOptionsT
-
src/ink/js/components/views/baseComponentView.ts (Diff revision 1) Got a mix here. Let's use
TElement
andTOptions
Change Summary:
Switched generics to
T*
naming conventions.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+1140 -2) |