@@ -245,8 +245,7 @@ Web component API:
245245- ` unmount ()` : Removes the instance's nodes from the DOM.
246246- ` dispose ()` : Releases instance resources (runtime listeners, reactive/context subscriptions, child instances) without removing nodes directly.
247247- ` render (data? )` : Forces a re-render of the instance, optionally with new data.
248- - ` send (event , data)` / ` pub (event , data)` : Publishes an event upward through the component tree.
249- - ` emit (event , data)` : Alias for ` pub (event , data)` .
248+ - ` pub (event , data)` : Publishes an event upward through the component tree.
250249- ` on (event , handler)` / ` off (event , handler)` : Adds or removes runtime event listeners on the instance.
251250- ` provide (key, value)` : Provides a context value to be consumed by child instances.
252251- ` inject (key, defaultValue? )` : Consumes a context value provided by an ancestor instance.
@@ -657,7 +656,7 @@ const Item = ui(`
657656 < / li>
658657` ).does({
659658 name: (self, { name }) => name,
660- remove: (self, data) => self.send ("Remove", data),
659+ remove: (self, data) => self.pub ("Remove", data),
661660});
662661
663662const List = ui(` < ul out= " items" >< / ul> ` )
@@ -746,7 +745,7 @@ const LoginForm = ui("#LoginForm").does({
746745 event ? self.update({ password: event.target.value }) : data.password,
747746 submit: (self, { username, password }, event) => {
748747 event.preventDefault();
749- self.send ("Login", { username, password });
748+ self.pub ("Login", { username, password });
750749 },
751750});
752751` ` `
@@ -884,7 +883,7 @@ const Button = ui(`
884883 isDisabled: (self, { disabled, loading }) => disabled || loading,
885884 click: (self, data, event) => {
886885 if (!data.disabled && !data.loading) {
887- self.send ("Click", data);
886+ self.pub ("Click", data);
888887 }
889888 },
890889});
0 commit comments