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

cheap-di-react

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cheap-di-react - npm Package Compare versions

Comparing version 4.0.2 to 4.0.3

dist/ReactContainer.test.d.ts

19

dist/hooks/index.js
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./useDiContext"), exports);
tslib_1.__exportStar(require("./use"), exports);
__exportStar(require("./useDiContext"), exports);
__exportStar(require("./use"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./DiContext"), exports);
tslib_1.__exportStar(require("./Providers"), exports);
tslib_1.__exportStar(require("./hooks"), exports);
__exportStar(require("./DiContext"), exports);
__exportStar(require("./Providers"), exports);
__exportStar(require("./hooks"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DIOneTimeProvider = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");

@@ -9,3 +19,3 @@ const react_1 = require("react");

const DIOneTimeProvider = props => {
const { dependencies, self, children } = props, rest = tslib_1.__rest(props, ["dependencies", "self", "children"]);
const { dependencies, self, children } = props, rest = __rest(props, ["dependencies", "self", "children"]);
const memoizedDependencies = (0, react_1.useMemo)(() => dependencies, []);

@@ -12,0 +22,0 @@ const memoizedSelfDependencies = (0, react_1.useMemo)(() => self, []);

34

dist/Providers/DIProvider.test.js
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");

@@ -102,3 +116,3 @@ const react_1 = require("@testing-library/react");

describe('singleton and stateful', () => {
test('singleton', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
test('singleton', () => __awaiter(void 0, void 0, void 0, function* () {
let MySingleton = class MySingleton {

@@ -109,3 +123,3 @@ constructor() {

loadData() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
return __awaiter(this, void 0, void 0, function* () {
this.data = yield Promise.resolve('loaded data');

@@ -115,3 +129,3 @@ });

};
MySingleton = tslib_1.__decorate([
MySingleton = __decorate([
cheap_di_1.singleton

@@ -136,3 +150,3 @@ ], MySingleton);

expect(queryAllByText('loaded data').length).toBe(0);
yield (0, react_1.act)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
yield (0, react_1.act)(() => __awaiter(void 0, void 0, void 0, function* () {
react_1.fireEvent.click(getByTestId(buttonId));

@@ -144,3 +158,3 @@ }));

}));
test('nested singletons', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
test('nested singletons', () => __awaiter(void 0, void 0, void 0, function* () {
let Service1 = class Service1 {

@@ -151,3 +165,3 @@ constructor() {

};
Service1 = tslib_1.__decorate([
Service1 = __decorate([
cheap_di_1.singleton

@@ -160,3 +174,3 @@ ], Service1);

};
Service2 = tslib_1.__decorate([
Service2 = __decorate([
cheap_di_1.singleton

@@ -169,3 +183,3 @@ ], Service2);

};
Service3 = tslib_1.__decorate([
Service3 = __decorate([
cheap_di_1.singleton

@@ -188,3 +202,3 @@ ], Service3);

expect(queryByText('000')).toBeNull();
yield (0, react_1.act)(() => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
yield (0, react_1.act)(() => __awaiter(void 0, void 0, void 0, function* () {
react_1.fireEvent.click(getByTestId(buttonId));

@@ -191,0 +205,0 @@ }));

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./DIOneTimeProvider"), exports);
tslib_1.__exportStar(require("./DIProvider"), exports);
__exportStar(require("./DIOneTimeProvider"), exports);
__exportStar(require("./DIProvider"), exports);
//# sourceMappingURL=index.js.map
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./InternalLogger"), exports);
__exportStar(require("./InternalLogger"), exports);
//# sourceMappingURL=index.js.map
{
"name": "cheap-di-react",
"version": "4.0.2",
"version": "4.0.3",
"description": "",

@@ -14,3 +14,3 @@ "scripts": {

"@types/react": "18.0.12",
"cheap-di": "3.4.2",
"cheap-di": "3.4.4",
"jest": "28.1.1",

@@ -17,0 +17,0 @@ "jest-environment-jsdom": "28.1.1",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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