-
Notifications
You must be signed in to change notification settings - Fork 27
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
New component function, refactor TodoMVC #111
Conversation
bc7f7e4
to
91c07a7
Compare
props?: { | ||
[name: string]: Showable | Behavior<Showable | boolean>; | ||
}; | ||
props?: Attributes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the same, since attributes are HTML attributes and not the properties on the DOMElement.
Since an attribute could be set in the HTML without any value, we need the boolean, however this is not the case for properties on the DOMElement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I didn't notice that changing it added boolean
to props
. But, I've looked it up the documentation here and there are actually a couple of boolean-valued properties: spellcheck
, translate
, draggable
, hidden
, and more. So maybe this change is actually ok after all?
const valueB: any = b[key]; | ||
if (valueA !== undefined) { | ||
if (isStream(valueA) && isStream(valueB)) { | ||
(a as any)[key] = valueA.combine(valueB); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 😃
Renames
loop
tocomponent
and makes it handle a return value that allows setting the available output of the resulting component.Updates the TodoMVC example to use
component
instead ofmodelView
and refactors it to follow other, IMHO, best practices.More than 100 lines of code shaved off in the TodoMVC.