import { Name } from './name.js' import Comments from './comment.js' export default { components: { Name, Comments }, data: ()=> ({ message: '', channel: 'demo' }), methods: { messageObjects(objects) { return objects.filter(o=> 'message' in o && 'timestamp' in o && typeof o.message == 'string' && typeof o.timestamp == 'number') .sortBy('timestamp') }, sendMessage() { if (!this.message) return this.$graffitiUpdate({ message: this.message, timestamp: Date.now(), _tags: [this.channel] }) this.message = '' } }, template: `

Chat Channel:

` }