1.0.8 • Published 3 years ago

helper-hooks v1.0.8

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

helper-hooks

Description

This package contains hooks that were mainly made for react-native, but they also might work for react. Current hooks in this package are:

useArray

Values sent to hook

PropInitial value
initialArray[]

Values returned from hook

Return valueParametersDescription
push(element:any)Adds an element to the end of the array
popNoneRemoves the last item in the array and returns it
clearNoneRemoves all of the elements from the array
remove(index:number)Removes item on a certain index
insert(item:any,index:number)Inserts an element on a certain index
replace(item:any,index:number)Replaces an element on a certain index
setArray([])Method for updating the array, if it's not present on the list
removeDoubleValuesNoneRemoves all of the double values ex. 1,2,2,3 returns 1,2,3
arrayvalueJust the array value

useToggle

Values sent to hook

PropInitial value
initialStatefalse

Values returned from hook

Return valueDescription
stateTrue or false value
toggleFunction for toggling ste state

Update

I will continue adding hooks to this package whenever I need to use some of them inside a project.

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago