Skip to content

Commit

Permalink
Add a static .prefetch() method to async! wrapper
Browse files Browse the repository at this point in the history
import Foo from 'async!./foo'

Foo.prefetch()  // we know we'll want it.

render(<Foo />)
  • Loading branch information
developit committed Jul 27, 2018
1 parent 6742f94 commit 4448cff
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/components/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ export default function(req) {
this.render = (p, s) => s.child ? h(s.child, p) : old;
}
(Async.prototype = new Component).constructor = Async;
Async.prefetch = req;
return Async;
}

0 comments on commit 4448cff

Please sign in to comment.