reshow-return
Advanced tools
Comparing version 0.17.36 to 0.17.37
@@ -12,3 +12,3 @@ "use strict"; | ||
var _jsxRuntime = require("react/jsx-runtime"); | ||
var _excluded = ["children", "backfillProps"]; | ||
var _excluded = ["children", "backfillProps"]; // @ts-check | ||
/** | ||
@@ -21,3 +21,2 @@ * @typedef {object} GetReturnOptions | ||
*/ | ||
/** | ||
@@ -27,6 +26,5 @@ * @typedef {object} ReturnProps | ||
* @property {import("../../connectOptions").InitStatesProps} initStates | ||
* @property {import("react").ReactChild} [children] | ||
* @property {import("react").ReactChild} [children] | ||
* @property {boolean} [backfillProps] | ||
*/ | ||
/** | ||
@@ -33,0 +31,0 @@ * @param {GetReturnOptions} props |
@@ -10,5 +10,20 @@ "use strict"; | ||
var _callFunc = _interopRequireDefault(require("call-func")); | ||
var _reshowConstant = require("reshow-constant"); | ||
var _Return = _interopRequireDefault(require("./ui/organisms/Return.js")); | ||
// @ts-check | ||
/** | ||
* @template StateType | ||
* @typedef {import('reshow-flux-base').DispatchType<StateType>} DispatchType | ||
*/ | ||
/** | ||
* @template ChildrenType | ||
* @param {string[]} initRenderKeys | ||
* @param {ChildrenType[]} initChildren | ||
* @returns {[React.ReactElement[], DispatchType<ChildrenType>, DispatchType<any>]} | ||
*/ | ||
var usePartialRender = function usePartialRender(initRenderKeys, initChildren) { | ||
var _useReduceStore = (0, _reshowFlux.useReduceStore)(null, function () { | ||
var _useReduceStore = (0, _reshowFlux.useReduceStore)(function (state, action) { | ||
return (0, _reshowFlux.mergeMap)(state, action); | ||
}, function () { | ||
return (0, _reshowFlux.Map)((0, _callFunc["default"])(initChildren)); | ||
@@ -32,3 +47,7 @@ }), | ||
*/ | ||
return (renderKeys && renderKeys.map ? renderKeys : []).map(function (name) { | ||
return ((0, _reshowConstant.IS_ARRAY)(renderKeys) ? renderKeys : []).map( | ||
/** | ||
* @param {string} name | ||
*/ | ||
function (name) { | ||
return buildReturn({ | ||
@@ -38,3 +57,7 @@ key: name, | ||
initStates: [name] | ||
}, function (props) { | ||
}, | ||
/** | ||
* @param {any} props | ||
*/ | ||
function (props) { | ||
return props[props.name] || null; | ||
@@ -41,0 +64,0 @@ }); |
{ | ||
"version": "0.17.36", | ||
"version": "0.17.37", | ||
"name": "reshow-return", | ||
@@ -4,0 +4,0 @@ "repository": { |
@@ -9,3 +9,3 @@ export default Return; | ||
export type ReturnProps = { | ||
store: import("reshow-flux-base").StoreObject; | ||
store: import("reshow-flux-base").StoreObject<any>; | ||
initStates: import("../../connectOptions").InitStatesProps; | ||
@@ -18,3 +18,3 @@ children?: import("react").ReactChild; | ||
*/ | ||
declare function Return(props: ReturnProps): JSX.Element; | ||
declare function Return(props: ReturnProps): import("react/jsx-runtime").JSX.Element; | ||
declare namespace Return { | ||
@@ -41,4 +41,4 @@ export { displayName }; | ||
export function getReturn({ displayName, useConnect, cleanProps, options, }?: GetReturnOptions): { | ||
(props: ReturnProps): JSX.Element; | ||
(props: ReturnProps): import("react/jsx-runtime").JSX.Element; | ||
displayName: string; | ||
}; |
export default usePartialRender; | ||
declare function usePartialRender(initRenderKeys: any, initChildren: any): any[]; | ||
export type DispatchType<StateType> = import('reshow-flux-base').DispatchType<StateType>; | ||
/** | ||
* @template StateType | ||
* @typedef {import('reshow-flux-base').DispatchType<StateType>} DispatchType | ||
*/ | ||
/** | ||
* @template ChildrenType | ||
* @param {string[]} initRenderKeys | ||
* @param {ChildrenType[]} initChildren | ||
* @returns {[React.ReactElement[], DispatchType<ChildrenType>, DispatchType<any>]} | ||
*/ | ||
declare function usePartialRender<ChildrenType>(initRenderKeys: string[], initChildren: ChildrenType[]): [import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[], DispatchType<ChildrenType>, DispatchType<any>]; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50940
1452