You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.
Currently we are passing app into the UI elements to send events up. But this will create peer dependencies to app and make it harder to split out the UI elements into their own modules.
Instead we should just create a target callback for sending actions up. Such as:
functionaction(name,params){/* Handle action name */}self.views={channels: newChannels({target: action})}
and then in the UI element:
functionComposer(opts){opts=opts||{}this.target=opts.target||function(){}}Composer.prototype.render=function(){varself=thisvarinput=h('input',{placeholder: 'Send a message...',autofocus: true})returnh('form.composer',{onsubmit: function(e){e.preventDefault()varinput=this.querySelector('input')self.target('sendMessage',input.value)input.value=''}},input)}
Currently we are passing
app
into the UI elements to send events up. But this will create peer dependencies toapp
and make it harder to split out the UI elements into their own modules.Instead we should just create a
target
callback for sending actions up. Such as:and then in the UI element:
Or get more fancy and have the actions bubble up: https://gist.github.com/shama/33f7aaeb902a001637e8
The text was updated successfully, but these errors were encountered: