Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
warning(`Property 'mapper' expected but not found.`)
return nextOwnProps
}
let nextResult = Object.assign({ }, nextOwnProps)
delete nextResult.mapper // Do not pass the mapper down
nextResult = mapper(state, nextResult)
if (!shallowEqual(result, nextResult)) { result = nextResult }
return result
}
}
return withMapper(connectAdvanced(factory)(WrappedComponent), ...mappings)
}
filter: element.filter,
expression: element.expression,
},
};
// update props only if something actually changed
if (!isEqual(result, nextResult)) {
result = nextResult;
}
return result;
};
}
export const ElementWrapper = compose(
connectAdvanced(selectorFactory),
withPropsOnChange(
(props, nextProps) => !isEqual(props.element, nextProps.element),
props => {
const { element, createHandlers } = props;
const handlers = createHandlers(element, props.selectedPage);
// this removes element and createHandlers from passed props
return { handlers };
}
),
mapProps(props => {
// remove element and createHandlers from props passed to component
// eslint-disable-next-line no-unused-vars
const { element, createHandlers, selectedPage, ...restProps } = props;
return restProps;
})
)(Component);
}
ownProps = nextOwnProps;
state = nextState;
// change result if needed
if (needsUpdate) {
result = Object.assign({}, ownProps, updatable, info);
}
return result;
};
}
// Connected element
const ConnectedPageElement = connectAdvanced(selectorFactory)(PageElement);
export default ConnectedPageElement;
setCache(joinedPath, { actions })
}
// if the props did not change, return the old cached output
if (!result || !shallowEqual(lastProps, nextProps)) {
lastProps = nextProps
result = Object.assign({}, nextProps, { actions, dispatch })
}
return result
}
}
// connect this function to Redux
const KonnektedKlass = connectAdvanced(selectorFactory, { methodName: 'kea' })(Klass)
// If we were wrapping a stateless functional React component, add the plugin code to the connected component.
if (isStateless(Klass)) {
plugins.injectToConnectedClass.forEach(f => f(input, output, KonnektedKlass))
}
return KonnektedKlass
}
const selectorFactory = (dispatch, factoryOptions) => {
return (state, ownProps) => {
const facetState = selectors.createFacetStateSelector(
ownProps.facetName || resolvedFacetName,
)(state);
return {
...ownProps,
...(resolvedMapStateToProps
? resolvedMapStateToProps(facetState, ownProps, state)
: {}),
};
};
};
return connectAdvanced(selectorFactory, {
methodName: 'withFacetData',
shouldHandleStateChanges: true,
getDisplayName: name => `WithFacetData[${resolvedFacetName}](${name})`,
});
};
export function connectLean(options = plain) {
return connectAdvanced(
dispatch => {
const scopedStateCache = createCache();
const mappedStateCache = createCache({initial: null});
const propsCache = createCache();
const scopeCache = createCache();
var initialState = null;
var boundHandlers = null;
var finalProps = null;
var setStateCallbacks = [];
const handlerContext = {};
const handlers = pickFunctions(options);
var mapState = typeof options.mapState === "function"
? options.mapState
: state => {
export default function resizableFlex(size) {
if (!isFlexResizingSupported()) {
return shamResizableFlex(size);
}
const instanceId = (nextInstanceId++).toString();
const getResizableFlexGrow = makeGetResizableFlexGrow(instanceId);
return connectAdvanced(
dispatch => {
const regions = times(size, () => ({current: null}));
const initialMainSizes = times(size, constant(null));
const stateIndependentFunctions = {
isFlexResizingSupported: true,
onResizableFlexDividerDrag(beforeIndex, event, payload) {
const afterIndex = findIndex(regions, 'current', beforeIndex + 1);
const [{current: before}, {current: after}] = at(regions, [
beforeIndex,
afterIndex,
]);
const {getCurrentSize, getDesiredSize} = directionAdapterFor(before);
return {
...ownProps,
...(mapDispatchToProps
? mapDispatchToProps(facetDispatch, ownProps, dispatch)
: {}),
facetDispatch,
};
};
};
const providedProps = isFunction(facetName) ? {} : { facetName };
return compose(
withProps(providedProps),
connectAdvanced(selectorFactory, {
methodName: 'facet',
shouldHandleStateChanges: false,
getDisplayName: name => `Facet[${resolvedFacetName}](${name})`,
}),
);
};
const mockConnect = () => RR.connectAdvanced(selectorDelegatorFactory)
function connectReaders(object) {
return connectAdvanced(readerSelectorsFactory(object));
}