Declarative, memoized, null-safe state selectors for redux and react-redux
Create shape of redux store to make requests
Connect from react-redux
, but simplified
recieves object with lenses, made component props from them
import { stateShape, Client, Order } from '../store'
type OrdersProps = {
orderId: number,
hasDiscount: boolean,
}
const AllOrders = stateShape
.orders
.select((orders, { orderId }) => orders.get(orderId))
const AllOrders = stateShape
.orders
.get(props => props.orderId)
const AllOrders = stateShape
.orders
.get(props.orderId)
const AllOrders = stateShape
.orders
.select(
.get(props.orderId)
const AllOrders = stateShape
.orders(find(props => props.orderId))