Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite3ccfba

Browse files
authored
Merge pull request#24 from rjz/doc/hoc
Clarifies higher-order component
2 parentsd9b2557 +b841a3d commite3ccfba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/decorators/loadable.tsx‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import*asReactfrom'react'
22

3+
// `loadable` is curried to decouple an `isLoading` check from the details of
4+
// component implementation
35
exportdefaultfunctionloadable<P>(isLoading:(p:P)=>boolean){
6+
// Return a higher-order component implementing the "loadable" behavior
7+
// See: https://goo.gl/TxPPCw
48
return(C:React.ComponentClass<P>|React.SFC<P>):React.SFC<P>=>{
59
constLoadableComponent:React.SFC<P>=(props)=>{
610
if(isLoading(props)){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp