Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const EditorPlugin = compose(
connect(selector,
(dispatch) => ({
onMount: bindActionCreators(setUp, dispatch),
gridEvents: bindActionCreators(gridEvents, dispatch),
pageEvents: bindActionCreators(pageEvents, dispatch),
initPlugin: bindActionCreators((options) => initPlugin(options), dispatch),
toolbarEvents: bindActionCreators(toolbarEvents, dispatch),
gridTools: gridTools.map((t) => ({
...t,
events: bindActionCreators(t.events, dispatch)
})),
onSizeChange: (...params) => dispatch(sizeChange(...params))
})
),
lifecycle({
componentDidMount() {
// only the passed properties will be picked
this.props.onMount(pick(this.props, ['showFilteredObject', 'showTimeSync', 'timeSync']));
}
})
)(FeatureDock);
module.exports = {
FeatureEditorPlugin: EditorPlugin,
epics: require('../epics/featuregrid'),
reducers: {
featuregrid: require('../reducers/featuregrid')
}
};
onHideSettings();
onShowAlertModal(false);
// clean up internal settings state
onUpdateOriginalSettings({});
onUpdateInitialSettings({});
}
},
onSave: ({ onUpdateInitialSettings = () => {}, onUpdateOriginalSettings = () => {}, onHideSettings = () => { }, onShowAlertModal = () => { } }) => () => {
onHideSettings();
onShowAlertModal(false);
// clean up internal settings state
onUpdateOriginalSettings({});
onUpdateInitialSettings({});
}
}),
lifecycle({
componentWillMount() {
const {
element = {},
onUpdateOriginalSettings = () => { },
onUpdateInitialSettings = () => { }
} = this.props;
// store changed keys
onUpdateOriginalSettings({ ...element });
// store initial settings (internal state)
onUpdateInitialSettings({ ...element });
},
componentWillReceiveProps(newProps) {
// an empty description does not trigger the single layer getCapabilites,
// it does only for missing description
const {
___scope___.file("components/formitem/hocs/temp.jsx", function(exports, require, module, __filename, __dirname){
var __decorate = __fsbx_decorate(arguments)
"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;
};
Object.defineProperty(exports, "__esModule", { value: true });
const react_1 = require("react");
const recompose_1 = require("recompose");
const pick_1 = require("recompose/utils/pick");
const metaConnect = recompose_1.compose(recompose_1.lifecycle({
shouldComponentUpdate: function (nextProps, nextState) {
console.group(nextProps.mergeSchema.keys + "---temp中比较formItemData和Meta的值得变化");
console.log("formItemData", pick_1.default(nextProps, ["formItemData"]).formItemData, pick_1.default(this.props, ["formItemData"]).formItemData);
console.log("meta", pick_1.default(nextProps, ["meta"]), pick_1.default(this.props, ["meta"]));
let rtn = !recompose_1.shallowEqual(pick_1.default(nextProps, ["formItemData"]).formItemData, pick_1.default(this.props, ["formItemData"]).formItemData) ||
!recompose_1.shallowEqual(pick_1.default(nextProps, ["meta"]).meta, pick_1.default(this.props, ["meta"]).meta);
console.log("shouldUpdate", rtn);
console.groupEnd();
return rtn;
}
}));
/**
* 包装Template的组件HOC
* @param Component 需要包装的组件
* @param options 参数
*/
const { xsltUpdated } = actionCreators;
const enhance = compose(
withRouter,
withHandlers({
openDocRef: ({ history }) => d => history.push(`/s/doc/${d.type}/${d.uuid}`)
}),
connect(
({ xslt }, { xsltId }) => ({
xslt: xslt[xsltId],
}),
{
fetchXslt, xsltUpdated, saveXslt,
},
),
lifecycle({
componentDidMount() {
const { fetchXslt, xsltId } = this.props;
fetchXslt(xsltId);
},
}),
branch(({ xslt }) => !xslt, renderComponent(() => )),
);
const XsltEditor = ({
xsltId, xslt, xsltUpdated, saveXslt, openDocRef, history,
}) => (
<header></header>
&& !sparkState.hasError
) {
getFeatures(props);
}
}
export default compose(
connect(
getMessageWidgetProps,
(dispatch) => bindActionCreators({
connectToMercury,
getFeature,
updateWidgetState
}, dispatch)
),
lifecycle({
componentWillMount() {
setup(this.props);
},
shouldComponentUpdate(nextProps) {
return nextProps !== this.props;
},
componentWillReceiveProps(nextProps) {
setup(nextProps, this.props);
}
})
);
import { connect } from 'react-redux';
import { compose, lifecycle, withState } from 'recompose';
const mapStateToProps = ({nodeStateStore}) => ({
nodeStateStore
});
const mapDispatchToProps = dispatch => ({
});
const enhance = lifecycle({
componentDidMount() {
},
componentDidUpdate() {
},
});
export default compose(
connect(
mapStateToProps,
mapDispatchToProps
),
enhance
);
const {
withScriptjs,
withGoogleMap,
GoogleMap,
FusionTablesLayer,
} = require("react-google-maps");
const { SearchBox } = require("react-google-maps/lib/components/places/SearchBox");
const MapWithAFusionTablesLayer = compose(
withProps({
googleMapURL: "https://maps.googleapis.com/maps/api/js?key=AIzaSyBipGTaEpZxIOqSRoYJakq64x9BQNjZwJs&v=3.exp&libraries=geometry,drawing,places",
loadingElement: <div style="{{">,
containerElement: <div style="{{">,
mapElement: <div style="{{">,
}),
lifecycle({
componentWillMount() {
const refs = {}
this.setState({
bounds: null,
center: {
lat: 45.4235937, lng: -75.7031177
},
markers: [],
onMapMounted: ref => {
refs.map = ref;
},
onBoundsChanged: () => {
this.setState({
bounds: refs.map.getBounds(),
center: refs.map.getCenter(),</div></div></div>
const hoc = compose(
connect(
state => {
return {isMusicEnabled: state.settings.isMusicEnabled};
},
dispatch => {
return {
setMusicEnabled: isEnabled => {
dispatch({
type: isEnabled ? "ENABLE_MUSIC" : "DISABLE_MUSIC"
});
}
};
}
),
lifecycle({
async componentWillMount() {
try {
const crashEnabled = await isCrashEnabled();
const eventsEnabled = await isEventsEnabled();
this.setState({
isEventsEnabled: eventsEnabled,
isCrashReportsEnabled: crashEnabled
});
} catch (e) {
this.setState({
isEventsEnabled: false,
isCrashReportsEnabled: false
});
}
}
}),
onDomainChange: setXDomain,
margins: {
top: 15,
right: 20,
bottom: 40,
left: 50,
},
});
}
}
const enhance = compose(
withState('xDomain', 'setXDomain', undefined),
withState('survivalContainer', 'setSurvivalContainer', null),
lifecycle({
shouldComponentUpdate(nextProps, nextState) {
return !_.isEqual(this.props, nextProps) || !_.isEqual(this.state, nextState);
},
componentDidUpdate() {
renderSurvivalPlot(this.props);
},
componentDidMount() {
renderSurvivalPlot(this.props);
},
})
);
export default enhance(SurvivalPlotWrapper);