0.1.2 • Published 1 year ago

@freakycoder/react-use-state-with-callback v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Battle Tested ✅

React Use State with Callback

npm version npm Platform - Android and iOS License: MIT styled with prettier

Installation

Add the dependency:

npm i @freakycoder/react-use-state-with-callback

Peer Dependencies

Zero Dependency

Usage

Import

import useStateWithCallback from "@freakycoder/react-use-state-with-callback";

Fundamental Usage

const [isSelected, setIsSelected] = useStateWithCallback<boolean>(false);

// USAGE
setIsSelected(true, (newValue: boolean) => console.log(newValue)); // true

Credits

Big thanks to MJ Studio from StackoverFlow. I just converted his awesome wrapper solution to a library.

MJ Studio's StackoverFlow Answer

Author

FreakyCoder, kurayogun@gmail.com

License

React Use State with Callback is available under the MIT license. See the LICENSE file for more info.