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

electrum-events

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

electrum-events - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

11

lib/event-handlers.js

@@ -20,3 +20,3 @@ 'use strict';

var EventHandlers = (function () {
function EventHandlers(props, bus) {
function EventHandlers(props, bus, valueGetter) {
_classCallCheck(this, EventHandlers);

@@ -32,2 +32,5 @@

}
this._valueGetter = valueGetter || function (t) {
return t.value;
};
}

@@ -112,3 +115,3 @@

var states = (0, _getTextSelection2.default)(target);
bus.notify(this._props, target.value, states);
bus.notify(this._props, this._valueGetter(target), states);
}

@@ -137,3 +140,5 @@ }

value: function inject(obj, props, bus) {
var eh = new EventHandlers(props, bus);
var eh = new EventHandlers(props, bus, obj.getValue && function (e) {
return obj.getValue(e.target);
});
/* jshint expr: true */

@@ -140,0 +145,0 @@ var existingOnFocus = obj.onFocus;

{
"name": "electrum-events",
"version": "1.0.0",
"version": "1.0.1",
"description": "Electrum Events forwards web component events to the bus.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -8,3 +8,3 @@ 'use strict';

export default class EventHandlers {
constructor (props, bus) {
constructor (props, bus, valueGetter) {
this._props = props;

@@ -16,2 +16,3 @@ if (typeof bus === 'function') {

}
this._valueGetter = valueGetter || (t => t.value);
}

@@ -56,3 +57,3 @@

static inject (obj, props, bus) {
const eh = new EventHandlers (props, bus);
const eh = new EventHandlers (props, bus, obj.getValue && (e => obj.getValue (e.target)));
/* jshint expr: true */

@@ -105,3 +106,3 @@ const existingOnFocus = obj.onFocus;

const states = getTextSelection (target);
bus.notify (this._props, target.value, states);
bus.notify (this._props, this._valueGetter (target), states);
}

@@ -108,0 +109,0 @@ }

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