Move example files to src.

I don't remember why I put these in FastImage in the first place.
This commit is contained in:
Dylan Vann
2018-05-09 22:13:18 -04:00
parent 6c6526e4e7
commit b206c50028
18 changed files with 1 additions and 1 deletions
@@ -0,0 +1,28 @@
import React, { Component } from 'react'
import uuid from 'uuid/v4'
export default BaseComponent => {
class WithCacheBust extends Component {
state = { bust: '?bust' }
onPressReload = () => {
// Force complete re-render and bust image cache.
const key = uuid()
const bust = `?bust=${key}`
this.setState({ bust })
}
render() {
return (
<BaseComponent
bust={this.state.bust}
onPressReload={this.onPressReload}
/>
)
}
}
WithCacheBust.displayName = `withCacheBust${BaseComponent.displayName}`
return WithCacheBust
}