1.3.37 • Published 2 years ago

@infini-soft/utils v1.3.37

Weekly downloads
-
License
MIT
Repository
github
Last release
2 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

2 years ago

1.3.35

2 years ago

1.3.36

2 years ago

1.3.33

2 years ago

1.3.34

2 years ago

1.3.37

2 years ago

1.3.31

2 years ago

1.3.30

2 years ago

1.3.29

2 years ago

1.3.27

2 years ago

1.3.24

2 years ago

1.3.23

2 years ago

1.3.20

2 years ago

1.3.19

2 years ago

1.3.18

2 years ago

1.3.15

2 years ago

1.3.14

2 years ago

1.3.13

2 years ago

1.3.12

2 years ago

1.3.10

2 years ago

1.3.9

2 years ago

1.3.8

2 years ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago