Create re-state selector
This method select any data from store and update when change
//MyComponent.tsximport { useReStateSelector } from '@raulpesilva/re-state'import type { Muted } from './mutedState'import { key } from './mutedState'
type Store = { [key]: Muted }
export const MyComponent = () => { const muted = useReStateSelector<Store, Boolean>(({ muted }) => muted)
return ( <div> <span>{muted ? 'Is muted' : 'Is unMuted'}</span> </div> )}
type Store = { MeyKey: Boolean }type DataToReturn = booleantype Selector<Store, DataToReturn = Store> = (store: Store) => DataToReturn
const result: DataToReturn = useReStateSelector<Store,DataToReturn>(selector: Selector, equalityFn?: Function)