If you have to extend an existing object with additional property, always prefer Vue.set()
over Object.assign()
(or spread operator).
Example below explains implications for different implementations.
// skip import for KO (Knockout.js) here, it should be available in global deps | |
import Vue from 'vue'; | |
import ProjectsConversationWrapper from 'ProjectsConversationWrapper'; | |
import { getProjectConversation } from 'api'; | |
// unique component identifier | |
const uniqueId = 'chat-project-room'; | |
const bindingHandlerInit = async (element, valueAccessor) => { | |
const projectId = parseInt(ko.unwrap(valueAccessor()), 10); |