-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
I'm starting to use react-skeletor, and I'm missing something in the API: a connector to access the isPending and have my own logic of rendering, for example a component to render an avatar:
import { connectSkeleton } from '@trainline/react-skeletor';
@connectSkeleton(({ isPending }) => ({
isPending
})
class Avatar extends React.Component {
render() {
const { isPending } = this.props;
return isPending ? <div></div> : <a href="...">...</a>
}
}Currently, I can directly use contextTypes and get the skeleton context, but this is a not recommended API by React.
At some point, it may requires a subscribing schema in the context instead of storing the values directly.
Will you be willing to accept a connectSkeleton API ? (I can make a PR)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels