Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-functional-data-merge

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-functional-data-merge

Vue.js util for intelligently merging data passed to functional components.

  • 3.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
323K
decreased by-7.24%
Maintainers
1
Weekly downloads
 
Created

What is vue-functional-data-merge?

The vue-functional-data-merge package is a utility for merging data objects in Vue.js functional components. It helps in combining props, attributes, and listeners in a way that is consistent with Vue's internal behavior.

What are vue-functional-data-merge's main functionalities?

Merging Props

This feature allows you to merge props from multiple data objects into a single data object. This is useful when you need to combine props from different sources in a functional component.

const { mergeData } = require('vue-functional-data-merge');

const data1 = { props: { foo: 'bar' } };
const data2 = { props: { baz: 'qux' } };
const mergedData = mergeData(data1, data2);
console.log(mergedData); // { props: { foo: 'bar', baz: 'qux' } }

Merging Attributes

This feature allows you to merge attributes from multiple data objects into a single data object. This is useful when you need to combine attributes from different sources in a functional component.

const { mergeData } = require('vue-functional-data-merge');

const data1 = { attrs: { id: 'foo' } };
const data2 = { attrs: { class: 'bar' } };
const mergedData = mergeData(data1, data2);
console.log(mergedData); // { attrs: { id: 'foo', class: 'bar' } }

Merging Event Listeners

This feature allows you to merge event listeners from multiple data objects into a single data object. This is useful when you need to combine event listeners from different sources in a functional component.

const { mergeData } = require('vue-functional-data-merge');

const data1 = { on: { click: () => console.log('clicked 1') } };
const data2 = { on: { click: () => console.log('clicked 2') } };
const mergedData = mergeData(data1, data2);
console.log(mergedData); // { on: { click: [ [Function], [Function] ] } }

Other packages similar to vue-functional-data-merge

Keywords

FAQs

Package last updated on 01 Jun 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc