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

reshow-return

Package Overview
Dependencies
Maintainers
1
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reshow-return - npm Package Compare versions

Comparing version 0.18.0 to 0.18.1

21

build/cjs/connectOptions.js

@@ -10,3 +10,2 @@ "use strict";

var _reshowConstant = require("reshow-constant");
var _reshowFluxBase = require("reshow-flux-base");
//@ts-check

@@ -61,6 +60,2 @@

/**
* @typedef {Record<string, any>} StateObject
*/
/**
* @typedef { string[] | InitStateObject } InitStatesType

@@ -105,5 +100,8 @@ */

/**
* @template StateType
* @template ActionType
*
* @typedef {object} calculateOptions
* @property {InitStatesType} initStates
* @property {StoreObject} store
* @property {import("reshow-flux-base").StoreObject<StateType, ActionType>} store
* @property {PathStates=} pathStates

@@ -115,5 +113,8 @@ * @property {string[]=} excludeStates

/**
* @param {StateObject} prevState
* @param {calculateOptions} calculateOptions
* @returns {StateObject}
* @template StateType
* @template ActionType
*
* @param {StateType} prevState
* @param {calculateOptions<StateType, ActionType>} calculateOptions
* @returns {StateType}
*/

@@ -166,3 +167,3 @@ var calculateState = function calculateState(prevState, calculateOptions) {

}
return bSame ? prevState : results;
return /**@type StateType*/bSame ? prevState : results;
};

@@ -169,0 +170,0 @@ var _default = exports["default"] = {

@@ -23,4 +23,7 @@ "use strict";

/**
* @template StateType
* @template ActionType
*
* @typedef {object} ReturnProps
* @property {import("reshow-flux-base").StoreObject} store
* @property {import("reshow-flux-base").StoreObject<StateType, ActionType>} store
* @property {import("../../connectOptions").InitStatesType} initStates

@@ -45,3 +48,6 @@ * @property {{[key: string]: string[]}} [pathStates]

/**
* @param {ReturnProps} props
* @template StateType
* @template ActionType
*
* @param {ReturnProps<StateType, ActionType>} props
*/

@@ -48,0 +54,0 @@ var Return = function Return(props) {

@@ -12,16 +12,24 @@ "use strict";

/**
* @type {import('./useReturn').UseReturnType}
* @template StateType
* @template ActionType
*
* @typedef {import('./useReturn').UseReturnType<StateType, ActionType>} UseReturnType
*/
var useClientReturn = function useClientReturn() {
var _ref;
if ((0, _hydrate["default"])() || (_ref = arguments.length <= 2 ? undefined : arguments[2]) !== null && _ref !== void 0 && _ref.isHydrate) {
var state = _useReturn["default"].apply(void 0, arguments);
/**
* @template StateType
* @template ActionType
*
* @type {UseReturnType<StateType, ActionType>}
*/
var useClientReturn = function useClientReturn(p1, p2, p3) {
if ((0, _hydrate["default"])() || p3 !== null && p3 !== void 0 && p3.isHydrate) {
var p2Any = /**@type any*/p2;
var state = (0, _useReturn["default"])(p1, p2Any, p3);
var isLoad = (0, _reshowHooks.useLoaded)();
if (isLoad) {
return state;
} else {
return {};
}
return /**@type StateType*/isLoad ? state : {};
} else {
return _useReturn["default"].apply(void 0, arguments);
var _p2Any = /**@type any*/p2;
var anyState = /**@type any*/(0, _useReturn["default"])(p1, _p2Any, p3);
return /**@type StateType*/anyState;
}

@@ -28,0 +36,0 @@ };

@@ -21,10 +21,18 @@ "use strict";

/**
* @template StateType
* @template ActionType
*
* @callback UseReturnType
* @param {import('./connectOptions').InitStatesType} initStates
* @param {import("reshow-flux-base").StoreObject} store
* @param {import("reshow-flux-base").StoreObject<StateType, ActionType>} store
* @param {UseReturnPayLoad} [payload]
*
* @returns {StateType}
*/
/**
* @type UseReturnType
* @template StateType
* @template ActionType
*
* @type UseReturnType<StateType, ActionType>
*/

@@ -48,5 +56,5 @@ var useReturn = function useReturn(initStates, store, _temp) {

});
return state;
return /**@type StateType*/state;
};
var _default = exports["default"] = useReturn;
module.exports = exports.default;
{
"version": "0.18.0",
"version": "0.18.1",
"name": "reshow-return",

@@ -4,0 +4,0 @@ "repository": {

@@ -8,3 +8,2 @@ export function stateKeyLocator(initStates: InitStatesType): [InitStatesType extends string[] ? InitStatesType : (keyof InitStateObject)[], (arg0: string) => string];

export type InitStateObject = Record<string, string>;
export type StateObject = Record<string, any>;
export type InitStatesType = string[] | InitStateObject;

@@ -14,5 +13,5 @@ export type PathStates = {

};
export type calculateOptions = {
export type calculateOptions<StateType, ActionType> = {
initStates: InitStatesType;
store: StoreObject<any, any>;
store: import("reshow-flux-base").StoreObject<StateType, ActionType>;
pathStates?: PathStates | undefined;

@@ -26,5 +25,8 @@ excludeStates?: string[] | undefined;

/**
* @template StateType
* @template ActionType
*
* @typedef {object} calculateOptions
* @property {InitStatesType} initStates
* @property {StoreObject} store
* @property {import("reshow-flux-base").StoreObject<StateType, ActionType>} store
* @property {PathStates=} pathStates

@@ -35,7 +37,10 @@ * @property {string[]=} excludeStates

/**
* @param {StateObject} prevState
* @param {calculateOptions} calculateOptions
* @returns {StateObject}
* @template StateType
* @template ActionType
*
* @param {StateType} prevState
* @param {calculateOptions<StateType, ActionType>} calculateOptions
* @returns {StateType}
*/
declare function calculateState(prevState: StateObject, calculateOptions: calculateOptions): StateObject;
declare function calculateState<StateType, ActionType>(prevState: StateType, calculateOptions: calculateOptions<StateType, ActionType>): StateType;
/**

@@ -47,2 +52,1 @@ * @param {object} props

declare function reset(props: object, more?: object): object;
import { StoreObject } from "reshow-flux-base";

@@ -8,4 +8,4 @@ export default Return;

};
export type ReturnProps = {
store: import("reshow-flux-base").StoreObject<any, any>;
export type ReturnProps<StateType, ActionType> = {
store: import("reshow-flux-base").StoreObject<StateType, ActionType>;
initStates: import("../../connectOptions").InitStatesType;

@@ -28,4 +28,7 @@ pathStates?: {

/**
* @template StateType
* @template ActionType
*
* @typedef {object} ReturnProps
* @property {import("reshow-flux-base").StoreObject} store
* @property {import("reshow-flux-base").StoreObject<StateType, ActionType>} store
* @property {import("../../connectOptions").InitStatesType} initStates

@@ -32,0 +35,0 @@ * @property {{[key: string]: string[]}} [pathStates]

export default useClientReturn;
export type UseReturnType<StateType, ActionType> = import('./useReturn').UseReturnType<StateType, ActionType>;
/**
* @type {import('./useReturn').UseReturnType}
* @template StateType
* @template ActionType
*
* @typedef {import('./useReturn').UseReturnType<StateType, ActionType>} UseReturnType
*/
declare const useClientReturn: import('./useReturn').UseReturnType;
/**
* @template StateType
* @template ActionType
*
* @type {UseReturnType<StateType, ActionType>}
*/
declare const useClientReturn: UseReturnType<StateType, ActionType>;

@@ -16,3 +16,3 @@ export default useReturn;

};
export type UseReturnType = (initStates: import('./connectOptions').InitStatesType, store: import("reshow-flux-base").StoreObject<any, any>, payload?: UseReturnPayLoad) => any;
export type UseReturnType<StateType, ActionType> = (initStates: import('./connectOptions').InitStatesType, store: import("reshow-flux-base").StoreObject<StateType, ActionType>, payload?: UseReturnPayLoad) => StateType;
/**

@@ -28,10 +28,18 @@ * @typedef {object} UseReturnPayLoad

/**
* @template StateType
* @template ActionType
*
* @callback UseReturnType
* @param {import('./connectOptions').InitStatesType} initStates
* @param {import("reshow-flux-base").StoreObject} store
* @param {import("reshow-flux-base").StoreObject<StateType, ActionType>} store
* @param {UseReturnPayLoad} [payload]
*
* @returns {StateType}
*/
/**
* @type UseReturnType
* @template StateType
* @template ActionType
*
* @type UseReturnType<StateType, ActionType>
*/
declare const useReturn: UseReturnType;
declare const useReturn: UseReturnType<StateType, ActionType>;

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