1.3.37 • Published 3 years ago

@infini-soft/utils v1.3.37

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Getting started

🌟 Utils

Utils is a small collection of helpers.

✨ Features

  • Events helpers
    • Attach/Detach event handlers
    • Attach once
    • Trigger CutomEvents with or without payload
  • Antd Table Sorters Factory

🤖 Use Case

  • Pass data accross React components without context or props
  • Attach event with custom UI behavior with low to no boilerplate

📚 Documentation

Get all documentation, examples and many more in the ☕ kitchen! Here

📦 Install

$ npm install @infini-soft/utils --save
# or
$ yarn add @infini-soft/utils

🔨 Usage

import React from 'react';
import { on, off, trigger} from '@infini-soft/utils';

const eventHandler = React.useCallback((payload)=>{
    alert(`Alert triggered!`)
},[])

React.useEffect(()=>{
    on('myevent', eventHandler);
    return () => off('myevent', eventHandler);
},[])

export default () => (
  <>
    <h1>Test it</h1>
    <button onClick={() => trigger('myevent', {data: 'my optional payload'})}>Test me</button>
  </>
);

Powered 🚀 by Infinisoft Inc. Wanna cook software? come in the kitchen https://www.kitchen.infini-soft.com

1.3.32

3 years ago

1.3.35

3 years ago

1.3.36

3 years ago

1.3.33

3 years ago

1.3.34

3 years ago

1.3.37

3 years ago

1.3.31

3 years ago

1.3.30

3 years ago

1.3.29

3 years ago

1.3.27

3 years ago

1.3.24

3 years ago

1.3.23

3 years ago

1.3.20

3 years ago

1.3.19

3 years ago

1.3.18

3 years ago

1.3.15

3 years ago

1.3.14

3 years ago

1.3.13

3 years ago

1.3.12

3 years ago

1.3.10

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.0

3 years ago