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

dnd-core

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dnd-core - npm Package Compare versions

Comparing version 0.5.3 to 0.5.4

26

dist-modules/__tests__/DragDropManager-test.js

@@ -162,18 +162,32 @@ "use strict";

it("calls setup() and teardown() on backend", function () {
expect(backend.isActive).to.equal(undefined);
expect(backend.didCallSetup).to.equal(undefined);
expect(backend.didCallTeardown).to.equal(undefined);
var sourceHandle = registry.addSource(Types.FOO, new NormalSource());
expect(backend.isActive).to.equal(true);
expect(backend.didCallSetup).to.equal(true);
expect(backend.didCallTeardown).to.equal(undefined);
backend.didCallSetup = undefined;
backend.didCallTeardown = undefined;
var targetHandle = registry.addTarget(Types.FOO, new NormalTarget());
expect(backend.isActive).to.equal(true);
expect(backend.didCallSetup).to.equal(undefined);
expect(backend.didCallTeardown).to.equal(undefined);
backend.didCallSetup = undefined;
backend.didCallTeardown = undefined;
registry.removeSource(sourceHandle);
expect(backend.isActive).to.equal(true);
expect(backend.didCallSetup).to.equal(undefined);
expect(backend.didCallTeardown).to.equal(undefined);
backend.didCallSetup = undefined;
backend.didCallTeardown = undefined;
registry.removeTarget(targetHandle);
expect(backend.isActive).to.equal(false);
expect(backend.didCallSetup).to.equal(undefined);
expect(backend.didCallTeardown).to.equal(true);
backend.didCallSetup = undefined;
backend.didCallTeardown = undefined;
registry.addTarget(Types.BAR, new NormalTarget());
expect(backend.isActive).to.equal(true);
expect(backend.didCallSetup).to.equal(true);
expect(backend.didCallTeardown).to.equal(undefined);
});

@@ -180,0 +194,0 @@

@@ -10,11 +10,10 @@ "use strict";

this.actions = actions;
this.isActive = undefined;
}
TestBackend.prototype.setup = function setup() {
this.isActive = true;
this.didCallSetup = true;
};
TestBackend.prototype.teardown = function teardown() {
this.isActive = false;
this.didCallTeardown = true;
};

@@ -21,0 +20,0 @@

@@ -28,6 +28,9 @@ "use strict";

DragDropManager.prototype.handleRefCountChange = function handleRefCountChange() {
if (this.flux.refCountStore.hasRefs()) {
var shouldSetUp = this.flux.refCountStore.hasRefs();
if (shouldSetUp && !this.isSetUp) {
this.backend.setup();
} else {
this.isSetUp = true;
} else if (!shouldSetUp && this.isSetUp) {
this.backend.teardown();
this.isSetUp = false;
}

@@ -34,0 +37,0 @@ };

@@ -25,15 +25,11 @@ "use strict";

this.createActions("dragDropActions", DragDropActions, manager);
this.dragDropActions = this.getActions("dragDropActions");
this.dragDropActions = this.createActions("dragDropActions", DragDropActions, manager);
this.dragDropActionIds = this.getActionIds("dragDropActions");
this.createActions("registryActions", RegistryActions);
this.registryActions = this.getActions("registryActions");
this.registryActions = this.createActions("registryActions", RegistryActions);
this.registryActionIds = this.getActionIds("registryActions");
this.createStore("dragOperationStore", DragOperationStore, this);
this.dragOperationStore = this.getStore("dragOperationStore");
this.dragOperationStore = this.createStore("dragOperationStore", DragOperationStore, this);
this.createStore("refCountStore", RefCountStore, this);
this.refCountStore = this.getStore("refCountStore");
this.refCountStore = this.createStore("refCountStore", RefCountStore, this);
}

@@ -40,0 +36,0 @@

{
"name": "dnd-core",
"version": "0.5.3",
"version": "0.5.4",
"description": "Drag and drop sans the GUI",

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

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