useSelector
function useSelector<T>(selectorFn: (state: any) => T): any
Gets a selection of the state from the store.
Template Parameters
Parameters
Returns
Examples
import React from 'react';
import { useSelector } from 'objective-redux';
export function MyFunctionalComponent() {
const { isOn } = useSelector(state => ({ isOn: state.switch.isOn }));
return <p>Switch is { isOn ? 'On' : 'Off' }</p>;
}