How to use dlv - 10 common examples

To help you get started, we’ve selected a few dlv 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 WeTrustPlatform / paramount / src / components / Rating / Rating.tsx View on Github external
{new Array(maxRating).fill(0).map((_, index) => {
        const currentValue = index + 1;

        const [StarR, starProps] = getOverrides(
          StyledStar,
          props,
          {
            color,
            maxRating,
            rating: value,
            value: currentValue,
            size,
            onPress: () => onValueChange(currentValue),
          },
          dlv(theme, 'overrides.Rating.Star'),
          overrides.Star,
        );

        return ;
      })}
github WeTrustPlatform / paramount / src / components / Switch / Switch.tsx View on Github external
onValueChange = () => {
      return;
    },
    overrides = {},
  } = props;
  const theme = useTheme();

  const [Touchable, touchableProps] = getOverrides(
    StyledTouchable,
    props,
    {
      isDisabled,
      size,
      onPress: () => onValueChange(!value),
    },
    dlv(theme, 'overrides.Switch.Touchable'),
    overrides.Touchable,
  );
  const [Background, backgroundProps] = getOverrides(
    StyledBackground,
    props,
    {
      isDisabled,
      size,
      value,
    },
    dlv(theme, 'overrides.Switch.Background'),
    overrides.Background,
  );
  const [Circle, circleProps] = getOverrides(
    StyledCircle,
    props,
github microlinkhq / www / src / components / hook / use-blog-index.js View on Github external
node {
              fields {
                slug
              }
              frontmatter {
                title
                date
              }
            }
          }
        }
      }
    `
  )

  return chain(get(allMarkdownRemark, 'edges'))
    .map(({ node }) => ({ ...node.fields, ...node.frontmatter }))
    .sort((a, b) => new Date(b.date) - new Date(a.date))
    .value()
}
github WeTrustPlatform / paramount / src / components / Typography / Label.tsx View on Github external
export const Label = (props: LabelProps) => {
  const { children, position = 'top', overrides = {}, label } = props;
  const theme = useTheme();

  const [Root, rootProps] = getOverrides(
    StyledRoot,
    props,
    {},
    dlv(theme, 'overrides.Label.Root'),
    overrides.Root,
  );
  const [Wrapper, wrapperProps] = getOverrides(
    StyledWrapper,
    props,
    { position },
    dlv(theme, 'overrides.Label.Wrapper'),
    overrides.Wrapper,
  );
  const [LabelText, labelTextProps] = getOverrides(
    StyledLabelText,
    props,
    { position, label },
    dlv(theme, 'overrides.Label.LabelText'),
    overrides.LabelText,
  );

  return (
    
      {position === 'top' && }
      
        {position === 'left' && }
        {children}
github arackaf / booklist / compare / react / modules / books / booksState.ts View on Github external
run: ({ currentResults, softReset }, resp) => {
        syncResults(currentResults.allBooks, "Books", resp.updateBooks ? resp.updateBooks.Books : [resp.updateBook.Book]);
        softReset(currentResults);
      }
    },
    {
      when: /deleteBook/,
      run: ({ refresh }, res, req) => {
        syncDeletes(GetBooksQuery, [req._id], "allBooks", "Books");
        refresh();
      }
    }
  ];
  const { data, loading, loaded, currentQuery } = useQuery(buildQuery(GetBooksQuery, variables, { onMutation: onBooksMutation }));

  const booksRaw = delve(data, "allBooks.Books") || null;
  const books = adjustBooks(booksRaw);
  const booksCount = loaded ? delve(data, "allBooks.Meta.count") : "";

  const resultsCount = booksCount != null ? booksCount : -1;
  const totalPages = useMemo(() => (resultsCount && resultsCount > 0 ? Math.ceil(resultsCount / searchState.pageSize) : 0), [resultsCount]);

  return {
    currentQuery,
    books,
    resultsCount,
    totalPages,
    booksLoading: loading,
    booksLoaded: loaded && tagsLoaded && subjectsLoaded
  };
};
github WeTrustPlatform / paramount / src / components / Layout / Row.tsx View on Github external
const {
    layout: { gutterWidth },
  } = useTheme();
  const theme = useTheme();

  return (
    
  );
};
github microlinkhq / www / src / components / pages / screenshot / examples.js View on Github external
const LiveDemo = ({ query, suggestions, onSubmit, isLoading }) => {
  const [inputBg, setInputBg] = useState(get(query, 'overlay.background') || '')
  const [inputUrl, setInputUrl] = useState(query.url || '')
  const [inputWaitFor, setInputWaitFor] = useState(query.waitFor || '')
  const [inputOverlay, setInputOverlay] = useState(
    get(query, 'overlay.browser') || ''
  )
  const domain = React.useMemo(() => getDomain(inputUrl), [inputUrl])

  const getValues = React.useCallback(() => {
    const preprendUrl = prependHttp(inputUrl)
    const overlay = pickBy({ browser: inputOverlay, background: inputBg })
    return pickBy({
      url: isUrl(preprendUrl) ? preprendUrl : undefined,
      waitFor: ms(inputWaitFor || '0'),
      overlay: isEmpty(overlay) ? undefined : overlay
    })
  }, [inputUrl, inputOverlay, inputBg, inputWaitFor])
github lukeed / is-ready / src / index.js View on Github external
	let fns = toArray(arr).map(x => dlv(window, x) !== void 0);
	return new Promise(r => {
github WeTrustPlatform / paramount / src / components / Pickers / WheelPicker.tsx View on Github external
{},
      dlv(theme, 'overrides.WheelPicker.Root'),
      overrides.Root,
    );
    const [ArrowUp, arrowUpProps] = getOverrides(
      StyledArrowUp,
      props,
      { onPress: handlePressUp },
      dlv(theme, 'overrides.WheelPicker.ArrowUp'),
      overrides.ArrowUp,
    );
    const [ArrowDown, arrowDownProps] = getOverrides(
      StyledArrowDown,
      props,
      { onPress: handlePressDown },
      dlv(theme, 'overrides.WheelPicker.ArrowDown'),
      overrides.ArrowDown,
    );
    const [UpperOverlay, upperOverlayProps] = getOverrides(
      StyledUpperOverlay,
      props,
      { pointerEvents: 'none' },
      dlv(theme, 'overrides.WheelPicker.UpperOverlay'),
      overrides.UpperOverlay,
    );
    const [BottomOverlay, bottomOverlayProps] = getOverrides(
      StyledBottomOverlay,
      props,
      { pointerEvents: 'none' },
      dlv(theme, 'overrides.WheelPicker.BottomOverlay'),
      overrides.BottomOverlay,
    );
github WeTrustPlatform / paramount / src / components / Switch / Switch.tsx View on Github external
isDisabled,
      size,
      value,
    },
    dlv(theme, 'overrides.Switch.Background'),
    overrides.Background,
  );
  const [Circle, circleProps] = getOverrides(
    StyledCircle,
    props,
    {
      isDisabled,
      size,
      value,
    },
    dlv(theme, 'overrides.Switch.Circle'),
    overrides.Circle,
  );

  return (
    
      
        
    
  );
};

dlv

Safely get a dot-notated property within an object.

MIT
Latest version published 6 years ago

Package Health Score

67 / 100
Full package analysis

Popular dlv functions