-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draft example API of how we could initialise components
First things first, this code has not even been run, it's only a draft of an API I think could be nice for initialising components, accounting for the nuances found in the different components of the Design System. - Some components run on a specific element, some not. So the API need to allow both. - When initialised on a specific element, the module name could be a static property of the component, however, it's probably useful to let it be set explicitely - Further selection, like finding the for the Copy, should probably be part of the component's responsibility, rather than the initialisation code - Similarly, if a component needs to be initialised only once, this could be part of the component's responsibility, rather thatn the initialisation loop. TypeScript might get in the way of having something so dynamic. Especially, I'm not 100% sure how we can note that a function accepts a 'class' as parameter. Seems it's a bit tricky based on this: microsoft/TypeScript#17572
- Loading branch information
1 parent
46604e7
commit 346885e
Showing
1 changed file
with
72 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters