Advanced use of ReduxConnection
to compose other Redux-stateful components.
import React from 'react'
import { ReduxConnection } from '@ghadyani-framework/redux-components'
import { authInfoSelector } from '~/redux/auth/selectors'
const IsAuthenticated = ({
children,
}) => (
<ReduxConnection selector={authInfoSelector}>
{({
hasReceivedAuthInfo,
isAuthenticated,
}) => (
hasReceivedAuthInfo
&& isAuthenticated
&& children
)}
</ReduxConnection>
)
export default IsAuthenticated