Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to render components: function-, block- and class-based. #1

Open
vlad-elagin opened this issue Nov 6, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@vlad-elagin
Copy link

Function-based components
Simple function that returns html string.

Block based components
Block is constructor for DOM node. Accepts multiple props: tag, className, children and events object.
Events object have following pattern:
{ [eventName]: eventHandler, click: () => null, }

Class based components
More customisable version of Block, implements auto subscription to store and can have it's own method. render method returns instance of Block.

@vlad-elagin vlad-elagin added the enhancement New feature or request label Nov 6, 2019
@vlad-elagin vlad-elagin self-assigned this Nov 6, 2019
@vlad-elagin
Copy link
Author

@usernamus how do we want to use function-based components? Pass function or result of function call to children of block?

@usernamus
Copy link
Member

The component lets contain a lot of blocks, but we must write functionality of rerendering. It's excruciating and will take a lot of time. How about partly rerendering in the scope only one component? As a sample: when a chat component takes a new message we want to change the only part with last message.

Blocks are only for generating HTML layout.

Good idea with events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants