How to use the recompose.pure function in recompose

To help you get started, we’ve selected a few recompose 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 i-novus-llc / n2o-framework / frontend / n2o / src / components / widgets / Form / FieldsetRow.jsx View on Github external
import { pure } from 'recompose';
import { Row } from 'reactstrap';
import FieldsetCol from './FieldsetCol';

function FieldsetRow({ rowId, row, ...rest }) {
  return (
    
      {row.cols &&
        row.cols.map((col, colId) => (
          
        ))}
    
  );
}

export default pure(FieldsetRow);
github prooph / event-store-mgmt-ui / src / EventStore / components / StreamFilter.tsx View on Github external
{text: ">", value: Filter.GREATER_THAN},
    {text: ">=", value: Filter.GREATER_THAN_EQUALS},
    {text: "<", value: Filter.LOWER_THAN},
    {text: "<=", value: Filter.LOWER_THAN_EQUALS},
    {text: "IN", value: Filter.IN},
    {text: "NOT IN", value: Filter.NOT_IN},
    {text: "REGEX", value: Filter.REGEX},
]

const handleEscape = (event: React.KeyboardEvent, props: StreamFilterProps) => {
    if(event.key === 'Escape') {
        props.onRemoveFilter(props.index);
    }
}

export const StreamFilter = pure((props: StreamFilterProps) => {

    const propertyOptions = props.existingFilterProps.map(prop =&gt; <option value="{prop}">).toJS();

    const autoFocus = typeof props.autoFocus === 'undefined'? true : props.autoFocus;

    return 
         props.onPropertyChanged(props.index, event.target.value)}
            onKeyDown={(event) =&gt; handleEscape(event, props) }</option>
github cncf / landscapeapp / src / components / Footer.js View on Github external
import React from 'react';
import { pure } from 'recompose';
import OutboundLink from './OutboundLink';
import settings from 'project/settings.yml'

const Footer = () =&gt; {
  return <div style="{{">
    {settings.home.footer} For more information, please see the&nbsp;
    
      license
     info.
  </div>
}
export default pure(Footer);
github elastic / kibana / x-pack / legacy / plugins / siem / public / components / open_timeline / title_row / index.tsx View on Github external
import { pure } from 'recompose';

import * as i18n from '../translations';
import { OpenTimelineProps } from '../types';
import { HeaderPanel } from '../../header_panel';

type Props = Pick &amp; {
  /** The number of timelines currently selected */
  selectedTimelinesCount: number;
};

/**
 * Renders the row containing the tile (e.g. Open Timelines / All timelines)
 * and action buttons (i.e. Favorite Selected and Delete Selected)
 */
export const TitleRow = pure(
  ({ onAddTimelinesToFavorites, onDeleteSelected, selectedTimelinesCount, title }) =&gt; (
    
      {(onAddTimelinesToFavorites || onDeleteSelected) &amp;&amp; (
        
          {onAddTimelinesToFavorites &amp;&amp; (
            
              
                {i18n.FAVORITE_SELECTED}
github tsuruclient / tsuru / src / component / TimelineView / Timeline.jsx View on Github external
timeline: Object,
    timelineIndex: number,
    ownerInfo: Object,
    isStreaming: boolean,
    contents: Array,
    latestContentId: ?string,
    contentFormContent: Object,
    setTimelineMenu: Function,
    updateContentText: Function,
    setReply: Function,
    callApi: Function,
    deleteTimeline: Function,
    setScrollPosition: Function,
};

const Timeline = pure((props: Props) =&gt; (
github webiny / webiny-js / packages / app-page-builder / src / editor / plugins / elements / column / Column.js View on Github external
zIndex: 20,
    display: "flex"
});

const addIcon = css({
    color: "var(--mdc-theme-secondary)",
    transition: "transform 0.2s",
    "&amp;:hover": {
        transform: "scale(1.3)"
    },
    "&amp;::before, &amp;::after": {
        display: "none"
    }
});

const Column = pure(({ element, dropElement, togglePlugin }) =&gt; {
    return (
        
            
                
                    
                        {({ id, path, type, elements }) =&gt; (
                            
                                {!elements.length &amp;&amp; (
github elastic / kibana / x-pack / plugins / canvas / canvas_plugin_src / renderers / time_filter / components / pretty_duration / index.js View on Github external
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License;
 * you may not use this file except in compliance with the Elastic License.
 */

import { pure } from 'recompose';
import { PrettyDuration as Component } from './pretty_duration';

export const PrettyDuration = pure(Component);
github elastic / kibana / x-pack / legacy / plugins / siem / public / components / flow_controls / flow_direction_select.tsx View on Github external
*/

import { EuiFilterButton, EuiFilterGroup } from '@elastic/eui';
import React from 'react';

import { pure } from 'recompose';
import { FlowDirection } from '../../graphql/types';

import * as i18n from './translations';

interface Props {
  selectedDirection: FlowDirection;
  onChangeDirection: (value: FlowDirection) =&gt; void;
}

export const FlowDirectionSelect = pure(({ onChangeDirection, selectedDirection }) =&gt; (
  
     onChangeDirection(FlowDirection.uniDirectional)}
      data-test-subj={FlowDirection.uniDirectional}
    &gt;
      {i18n.UNIDIRECTIONAL}
    

     onChangeDirection(FlowDirection.biDirectional)}
      data-test-subj={FlowDirection.biDirectional}
    &gt;
      {i18n.BIDIRECTIONAL}
github webiny / webiny-js / packages / webiny-app-cms / src / editor / plugins / elements / document / Document.js View on Github external
//@flow
import React from "react";
import { pure } from "recompose";
import Element from "webiny-app-cms/editor/components/Element";
import type { ElementType } from "webiny-app-cms/types";

const Document = pure(({ element }: { element: ElementType }) =&gt; {
    return (
        <div>
            {element.elements.map(el =&gt; (
                <element id="{el}">
            ))}
        </element></div>
    );
});

export default Document;
github elastic / kibana / x-pack / legacy / plugins / siem / public / components / fields_browser / category_title.tsx View on Github external
CountBadgeContainer.displayName = 'CountBadgeContainer';

interface Props {
  /** The title of the category */
  categoryId: string;
  /**
   * A map of categoryId -&gt; metadata about the fields in that category,
   * filtered such that the name of every field in the category includes
   * the filter input (as a substring).
   */
  filteredBrowserFields: BrowserFields;
  /** The timeline associated with this field browser */
  timelineId: string;
}

export const CategoryTitle = pure(({ filteredBrowserFields, categoryId, timelineId }) =&gt; (
  
    
      
        <h5>{categoryId}</h5>
      
    

    
      
        
          {getFieldCount(filteredBrowserFields[categoryId])}