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

json-react-layouts-data-loader

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-react-layouts-data-loader - npm Package Compare versions

Comparing version 4.0.0-beta.5 to 4.0.0-beta.6

11

CHANGELOG.md
# json-react-layouts-data-loader
## 4.0.0-beta.6
### Minor Changes
- 9a6621d: Upgraded dependencies
### Patch Changes
- Updated dependencies [9a6621d]
- json-react-layouts@3.0.0-beta.6
## 4.0.0-beta.5

@@ -4,0 +15,0 @@

1

dist/cjs/get-data-args.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getComponentDataArgs = void 0;
function getComponentDataArgs(layout, componentType) {

@@ -4,0 +5,0 @@ var componentDataDefinition = layout.componentRegistrations.get(componentType);

32

dist/cjs/index.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getComponentDataArgs = exports.init = void 0;
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importDefault(require("react"));
var get_data_args_1 = require("./get-data-args");
exports.getComponentDataArgs = get_data_args_1.getComponentDataArgs;
Object.defineProperty(exports, "getComponentDataArgs", { enumerable: true, get: function () { return get_data_args_1.getComponentDataArgs; } });
// TODO this could have a better name

@@ -11,3 +11,3 @@ function init(resources,

wrapLoad) {
var ComponentDataLoader = resources.registerResource('component-data-loader', function (_a) {
var useComponentData = resources.registerResource('component-data-loader', function (_a) {
var dataDefinitionArgs = _a.dataDefinitionArgs, dataDefinition = _a.dataDefinition, layout = _a.layout, resourceType = _a.resourceType, paramsCacheKey = _a.paramsCacheKey, services = tslib_1.__rest(_a, ["dataDefinitionArgs", "dataDefinition", "layout", "resourceType", "paramsCacheKey"]);

@@ -46,13 +46,17 @@ var loadFn = wrapLoad ? wrapLoad(dataDefinition.loadData) : dataDefinition.loadData;

}
return (react_1.default.createElement(ComponentDataLoader, { layout: services.layout, dataDefinition: dataDefinition, dataDefinitionArgs: dataDefinitionArgs, renderData: function (renderProps) {
if (!renderProps.lastAction.success) {
// We have failed to load data, use error boundaries
// to send error back up and render error page
throw renderProps.lastAction.error;
}
var data = renderProps.data.hasData
? { data: { loaded: true, result: renderProps.data.result } }
: { data: { loaded: false } };
return (next(tslib_1.__assign(tslib_1.__assign({}, componentProps), data), middlewareProps, services) || null);
} }));
// eslint-disable-next-line react-hooks/rules-of-hooks
var renderProps = useComponentData({
dataDefinition: dataDefinition,
dataDefinitionArgs: dataDefinitionArgs,
layout: services.layout,
});
if (!renderProps.lastAction.success) {
// We have failed to load data, use error boundaries
// to send error back up and render error page
throw renderProps.lastAction.error;
}
var data = renderProps.data.hasData
? { data: { loaded: true, result: renderProps.data.result } }
: { data: { loaded: false } };
return (next(tslib_1.__assign(tslib_1.__assign({}, componentProps), data), middlewareProps, services) || null);
}

@@ -59,0 +63,0 @@ return next(componentProps, middlewareProps, services);

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

export {};
//# sourceMappingURL=DataLoading.js.map
import { __assign, __rest } from "tslib";
import React from 'react';
import { getComponentDataArgs } from './get-data-args';

@@ -8,3 +7,3 @@ // TODO this could have a better name

wrapLoad) {
var ComponentDataLoader = resources.registerResource('component-data-loader', function (_a) {
var useComponentData = resources.registerResource('component-data-loader', function (_a) {
var dataDefinitionArgs = _a.dataDefinitionArgs, dataDefinition = _a.dataDefinition, layout = _a.layout, resourceType = _a.resourceType, paramsCacheKey = _a.paramsCacheKey, services = __rest(_a, ["dataDefinitionArgs", "dataDefinition", "layout", "resourceType", "paramsCacheKey"]);

@@ -43,13 +42,17 @@ var loadFn = wrapLoad ? wrapLoad(dataDefinition.loadData) : dataDefinition.loadData;

}
return (React.createElement(ComponentDataLoader, { layout: services.layout, dataDefinition: dataDefinition, dataDefinitionArgs: dataDefinitionArgs, renderData: function (renderProps) {
if (!renderProps.lastAction.success) {
// We have failed to load data, use error boundaries
// to send error back up and render error page
throw renderProps.lastAction.error;
}
var data = renderProps.data.hasData
? { data: { loaded: true, result: renderProps.data.result } }
: { data: { loaded: false } };
return (next(__assign(__assign({}, componentProps), data), middlewareProps, services) || null);
} }));
// eslint-disable-next-line react-hooks/rules-of-hooks
var renderProps = useComponentData({
dataDefinition: dataDefinition,
dataDefinitionArgs: dataDefinitionArgs,
layout: services.layout,
});
if (!renderProps.lastAction.success) {
// We have failed to load data, use error boundaries
// to send error back up and render error page
throw renderProps.lastAction.error;
}
var data = renderProps.data.hasData
? { data: { loaded: true, result: renderProps.data.result } }
: { data: { loaded: false } };
return (next(__assign(__assign({}, componentProps), data), middlewareProps, services) || null);
}

@@ -56,0 +59,0 @@ return next(componentProps, middlewareProps, services);

{
"name": "json-react-layouts-data-loader",
"version": "4.0.0-beta.5",
"version": "4.0.0-beta.6",
"repository": "github:sevenwestmedia-labs/json-react-layouts",

@@ -11,8 +11,8 @@ "author": "Seven West Media WA",

"dependencies": {
"json-react-layouts": "^3.0.0-beta.5"
"json-react-layouts": "^3.0.0-beta.6"
},
"peerDependencies": {
"typescript-log": "^1.1.1",
"react-ssr-data-loader": "^1.3.0"
"typescript-log": "^2.0.0",
"react-ssr-data-loader": "^2.0.0-next.3"
}
}

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

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