import { Name } from './name.js' import LikeButton from './like-button.js' export default { components: { Name, LikeButton }, 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: