New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@morbidick/lit-element-notify

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@morbidick/lit-element-notify - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

16

lit-element-notify.js

@@ -1,2 +0,2 @@

export const notify = (baseElement) => class extends baseElement {
export const LitNotify = (baseElement) => class extends baseElement {
/**

@@ -20,4 +20,4 @@ * Extend the LitElement `createProperty` method to map properties to events

*/
update(props) {
super.update(props);
update(changedProps) {
super.update(changedProps);

@@ -29,3 +29,3 @@ if (!this.constructor._propertyEventMap) {

for (const [eventProp, eventName] of this.constructor._propertyEventMap.entries()) {
if (props.has(eventProp)) {
if (changedProps.has(eventProp)) {
this.dispatchEvent(new CustomEvent(eventName, {

@@ -46,7 +46,9 @@ detail: {

static _eventNameForProperty(name, options) {
if (options.notify && typeof options.notify === 'string')
if (options.notify && typeof options.notify === 'string') {
return options.notify;
}
if (options.attribute && typeof options.attribute === 'string')
if (options.attribute && typeof options.attribute === 'string') {
return `${options.attribute}-changed`;
}

@@ -57,2 +59,2 @@ return `${name.toLowerCase()}-changed`;

export default notify;
export default LitNotify;
{
"name": "@morbidick/lit-element-notify",
"version": "0.2.0",
"version": "0.3.0",
"description": "Small mixin for LitElement to get easy change events via the properties getter",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -17,5 +17,5 @@ # Change notification mixin for LitElement

import { LitElement, html } from '@polymer/lit-element/lit-element.js';
import notify from '@morbidick/lit-element-notify/lit-element-notify.js';
import LitNotify from '@morbidick/lit-element-notify/lit-element-notify.js';
class notifyingElement extends notify(LitElement) {
class NotifyingElement extends LitNotify(LitElement) {
static get properties() {

@@ -40,3 +40,3 @@ return {

// if an attribute value is set, -changed is appended
// if an attribute value is set, -changed is appended
anotherProperty: {

@@ -47,5 +47,6 @@ type: String,

},
};
}
}
```
```
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