How to use the merge function in merge

To help you get started, we’ve selected a few merge examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github datosgobar / consulta-publica / lib / topics-filter / topics-filter.js View on Github external
set (key, value) {
    if (2 === arguments.length) {
      // Create param object and call recursively
      var obj = {};
      obj[key] = value;
      return this.set(obj);
    }

    // key is an object
    merge(this.$_filters, key);

    // notify change of filters
    this.ready(onready.bind(this));

    function onready() {
      this.emit('change', this.get());
    }

    // reload items with updated filters
    this.reload();

    // save current state
    return this.save();
  }
github esnet / react-timeseries-charts / src / components / BandChart.js View on Github external
);
                }
                style = this.mutedStyle[level];
            }
        } else if (isHighlighted) {
            style = merge(
                true,
                defaultStyle[level].highlighted,
                this.providedStyle[level].highlighted ? this.providedStyle[level].highlighted : {}
            );
        } else {
            if (!this.normalStyle) {
                this.normalStyle = [];
            }
            if (!this.normalStyle[level]) {
                this.normalStyle[level] = merge(
                    true,
                    defaultStyle[level].normal,
                    this.providedStyle[level].normal ? this.providedStyle[level].normal : {}
                );
            }
            style = this.normalStyle[level];
        }
        return style;
    }
github esnet / react-timeseries-charts / src / components / YAxis.js View on Github external
labelStyle: merge(
                true,
                defaultStyle.label,
                this.props.style.label ? this.props.style.label : {}
            ),
            valueStyle: merge(
                true,
                defaultStyle.values,
                this.props.style.values ? this.props.style.values : {}
            ),
            axisStyle: merge(
                true,
                defaultStyle.axis,
                this.props.style.axis ? this.props.style.axis : {}
            ),
            tickStyle: merge(
                true,
                defaultStyle.ticks,
                this.props.style.ticks ? this.props.style.ticks : {}
            )
        };
    }
github esnet / react-timeseries-charts / src / components / AreaChart.js View on Github external
);
            } else {
                style = merge(
                    true,
                    defaultStyle[type].muted,
                    styleMap[type].muted ? styleMap[type].muted : {}
                );
            }
        } else if (isHighlighted) {
            style = merge(
                true,
                defaultStyle[type].highlighted,
                styleMap[type].highlighted ? styleMap[type].highlighted : {}
            );
        } else {
            style = merge(
                true,
                defaultStyle[type].normal,
                styleMap[type].normal ? styleMap[type].normal : {}
            );
        }
        return style;
    }
github esnet / react-timeseries-charts / src / components / BoxChart.js View on Github external
style = this.highlightedStyle[level];
            } else {
                if (!this.mutedStyle) {
                    this.mutedStyle = [];
                }
                if (!this.mutedStyle[level]) {
                    this.mutedStyle[level] = merge(
                        true,
                        defaultStyle[level].muted,
                        this.providedStyle[level].muted ? this.providedStyle[level].muted : {}
                    );
                }
                style = this.mutedStyle[level];
            }
        } else if (isHighlighted) {
            style = merge(
                true,
                defaultStyle[level].highlighted,
                this.providedStyle[level].highlighted ? this.providedStyle[level].highlighted : {}
            );
        } else {
            if (!this.normalStyle) {
                this.normalStyle = [];
            }
            if (!this.normalStyle[level]) {
                this.normalStyle[level] = merge(
                    true,
                    defaultStyle[level].normal,
                    this.providedStyle[level].normal ? this.providedStyle[level].normal : {}
                );
            }
            style = this.normalStyle[level];
github esnet / react-timeseries-charts / src / components / LineChart.js View on Github external
pathStyle(column) {
        let style;

        const styleMap = this.providedPathStyleMap(column);
        const isHighlighted = this.props.highlight && column === this.props.highlight;
        const isSelected = this.props.selection && column === this.props.selection;

        if (this.props.selection) {
            if (isSelected) {
                style = merge(
                    true,
                    defaultStyle.selected,
                    styleMap.selected ? styleMap.selected : {}
                );
            } else if (isHighlighted) {
                style = merge(
                    true,
                    defaultStyle.highlighted,
                    styleMap.highlighted ? styleMap.highlighted : {}
                );
            } else {
                style = merge(true, defaultStyle.muted, styleMap.muted ? styleMap.muted : {});
            }
        } else if (isHighlighted) {
            style = merge(
                true,
github esnet / react-timeseries-charts / src / components / YAxis.js View on Github external
mergeStyles(style) {
        return {
            labelStyle: merge(
                true,
                defaultStyle.label,
                this.props.style.label ? this.props.style.label : {}
            ),
            valueStyle: merge(
                true,
                defaultStyle.values,
                this.props.style.values ? this.props.style.values : {}
            ),
            axisStyle: merge(
                true,
                defaultStyle.axis,
                this.props.style.axis ? this.props.style.axis : {}
            ),
            tickStyle: merge(
                true,
github casesandberg / react-color / src / components / SketchPicker.js View on Github external
constructor(props: any) {
    super();

    this.state = merge(color.toState(props.color, 0), {
      visible: props.display,
    });

    this.debounce = debounce(function(fn: any, data: any) {
      fn(data);
    }, 100);

    this.handleChange = this.handleChange.bind(this);
    this.handleHide = this.handleHide.bind(this);
    this.handleAccept = this.handleAccept.bind(this);
    this.handleCancel = this.handleCancel.bind(this);
  }
github esnet / react-timeseries-charts / src / components / ScatterChart.js View on Github external
if (this.props.selected) {
            if (isSelected) {
                style = merge(
                    true,
                    defaultStyle.selected,
                    styleMap.selected ? styleMap.selected : {}
                );
            } else if (isHighlighted) {
                style = merge(
                    true,
                    defaultStyle.highlighted,
                    styleMap.highlighted ? styleMap.highlighted : {}
                );
            } else {
                style = merge(true, defaultStyle.muted, styleMap.muted ? styleMap.muted : {});
            }
        } else if (isHighlighted) {
            style = merge(
                true,
                defaultStyle.highlighted,
                styleMap.highlighted ? styleMap.highlighted : {}
            );
        } else {
            style = merge(true, defaultStyle.normal, styleMap.normal ? styleMap.normal : {});
        }

        return style;
    }

merge

(recursive)? merging of (cloned)? objects.

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis