Closed ianma closed 8 years ago
LGTM.
Something, in addition, that would have helped me is a tabular representation of the differences between the define functions.
defineRenderer | defineWidget | defineComponent | |
---|---|---|---|
server-side rendering | :x: | :x: | :x: |
client-side rendering | :x: | ||
client-side behavior | :x: | :x: |
Hey @ianma. Thanks for the PR. After looking more closely at the docs it looks like that last sentence should be similar to the following:
defineWidget(def)
The
defineWidget(def)
function can be used to define a UI component's client-side behavior independent of the code to render the UI component. This can be beneficial when a UI component needs to only be rendered on the server and it is desirable to avoid sending down the template and rendering logic to the browser. For UI components that are only rendered on the server, only the client-side behavior really needs to be be sent to the browser.The return value of
defineWidget(def)
will be a widget constructor function that is used to instantiate new widget instances.Does that work for you?