@loadsmart/utils-function
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

utils-function

useful functions for handling functions.

Install via NPM

$ npm i @loadsmart/utils-function --save

Install via yarn

$ yarn add @loadsmart/utils-function

Usage

import React from 'react'
import { isFunction } from '@loadsmart/utils-function'

export default ({ onClick }) => {
  const onClickHandler = isFunction(onClick) ? onClick : null

  return (
    <button type="button" onClick={onClickHandler}>
      Do something
    </button>
  )
}

/@loadsmart/utils-function/

    Package Sidebar

    Install

    npm i @loadsmart/utils-function

    Weekly Downloads

    34

    Version

    0.3.1

    License

    MIT

    Unpacked Size

    5.68 kB

    Total Files

    15

    Last publish

    Collaborators

    • bruno.manzo
    • felipe.asantos
    • giovannitoledo
    • douglasklein2
    • luiz.loadsmart
    • mwconceicao
    • yidi0912
    • lenoir.zamboni
    • diogomafra
    • oliver.tso
    • loadsmart-frontend
    • brennervaz
    • raittes
    • welingtonms-loadsmart
    • gutofoletto