Skip to content

Instantly share code, notes, and snippets.

View DawidMyslak's full-sized avatar

Dawid Myslak DawidMyslak

View GitHub Profile
@DawidMyslak
DawidMyslak / index.js
Last active November 10, 2021 02:54
Combining Vue.js and Knockout.js together
// 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);
@DawidMyslak
DawidMyslak / vue.md
Last active April 22, 2024 12:49
Vue.js and Vuex - best practices for managing your state

Vue.js and Vuex - best practices for managing your state

Modifying state object

Example

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.