chore: More social.

This commit is contained in:
Dylan Vann 2019-02-24 23:54:24 -05:00
parent 96f98c4d0b
commit f672f0bc85
1 changed files with 76 additions and 64 deletions

140
README.md
View File

@ -2,27 +2,21 @@
🚩 FastImage
</h1>
<p align="center">
Performant React Native image component.
</p>
<div align="center">
<p align="center">
<a href="https://www.npmjs.com/package/react-native-fast-image">
<img src="https://img.shields.io/npm/v/react-native-fast-image.svg?style=flat-square" alt="npm package">
</a>
<a href="https://www.npmjs.com/package/react-native-fast-image">
<img src="https://img.shields.io/npm/dm/react-native-fast-image.svg?style=flat-square" alt="npm downloads">
</a>
<a href="https://circleci.com/gh/DylanVann/react-native-fast-image/tree/master">
<img src="https://img.shields.io/circleci/project/github/DylanVann/react-native-fast-image/master.svg?style=flat-square" alt="CircleCI build status">
</a>
<a href="https://codecov.io/gh/DylanVann/react-native-fast-image">
<img src="https://img.shields.io/codecov/c/github/DylanVann/react-native-fast-image.svg?style=flat-square" alt="codecov">
</a>
<a href="https://github.com/DylanVann/react-native-fast-image/blob/master/LICENSE">
<img src="https://img.shields.io/github/license/DylanVann/react-native-fast-image.svg?style=flat-square" alt="license">
</a>
</p>
Performant React Native image component.
[![Version][version-badge]][package]
[![Downloads][downloads-badge]][npmtrends]
[![Build Status][build-badge]][build]
[![Code Coverage][coverage-badge]][coverage]
[![MIT License][license-badge]][license]
[![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![Tweet][twitter-badge]][twitter]
</div>
<p align="center" >
<kbd>
@ -42,10 +36,10 @@ headers for images you'll generally get the sort of built in
caching behavior you'd have in a browser.
Even so many people have noticed:
- Flickering.
- Cache misses.
- Low performance loading from cache.
- Low performance in general.
- Flickering.
- Cache misses.
- Low performance loading from cache.
- Low performance in general.
`FastImage` is an `Image` replacement that solves these issues.
`FastImage` is a wrapper around
@ -55,12 +49,12 @@ and
## Features
- [x] Aggressively cache images.
- [x] Add authorization headers.
- [x] Prioritize images.
- [x] Preload images.
- [x] GIF support.
- [x] Border radius.
- [x] Aggressively cache images.
- [x] Add authorization headers.
- [x] Prioritize images.
- [x] Preload images.
- [x] GIF support.
- [x] Border radius.
## Usage
@ -75,23 +69,24 @@ react-native link react-native-fast-image
```jsx
import FastImage from 'react-native-fast-image'
const YourImage = () =>
<FastImage
style={styles.image}
source={{
uri: 'https://unsplash.it/400/400?image=1',
headers:{ Authorization: 'someAuthToken' },
priority: FastImage.priority.normal,
}}
resizeMode={FastImage.resizeMode.contain}
/>
const YourImage = () => (
<FastImage
style={styles.image}
source={{
uri: 'https://unsplash.it/400/400?image=1',
headers: { Authorization: 'someAuthToken' },
priority: FastImage.priority.normal,
}}
resizeMode={FastImage.resizeMode.contain}
/>
)
```
## Other Linking Methods
- [Manual](docs/installation-manual.md) (might be needed if something went wrong with `react-native link`)
- [CocoaPods (iOS)](docs/installation-cocoapods.md) (you may wish to use this if you are already using CocoaPods)
- [Are you using Glide already using an AppGlideModule?](docs/app-glide-module.md) (you might have problems if you don't read this)
- [Manual](docs/installation-manual.md) (might be needed if something went wrong with `react-native link`)
- [CocoaPods (iOS)](docs/installation-cocoapods.md) (you may wish to use this if you are already using CocoaPods)
- [Are you using Glide already using an AppGlideModule?](docs/app-glide-module.md) (you might have problems if you don't read this)
## Proguard
@ -124,26 +119,26 @@ Headers to load the image with. e.g. `{ Authorization: 'someAuthToken' }`.
### `source.priority?: enum`
- `FastImage.priority.low` - Low Priority.
- `FastImage.priority.normal` **(Default)** - Normal Priority.
- `FastImage.priority.high` - High Priority.
- `FastImage.priority.low` - Low Priority.
- `FastImage.priority.normal` **(Default)** - Normal Priority.
- `FastImage.priority.high` - High Priority.
---
### `source.cache?: enum`
- `FastImage.cacheControl.immutable` - **(Default)** - Only updates if url changes.
- `FastImage.cacheControl.web` - Use headers and follow normal caching procedures.
- `FastImage.cacheControl.cacheOnly` - Only show images from cache, do not make any network requests.
- `FastImage.cacheControl.immutable` - **(Default)** - Only updates if url changes.
- `FastImage.cacheControl.web` - Use headers and follow normal caching procedures.
- `FastImage.cacheControl.cacheOnly` - Only show images from cache, do not make any network requests.
---
### `resizeMode?: enum`
- `FastImage.resizeMode.contain` - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).
- `FastImage.resizeMode.cover` **(Default)** - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).
- `FastImage.resizeMode.stretch` - Scale width and height independently, This may change the aspect ratio of the src.
- `FastImage.resizeMode.center` - Do not scale the image, keep centered.
- `FastImage.resizeMode.contain` - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or less than the corresponding dimension of the view (minus padding).
- `FastImage.resizeMode.cover` **(Default)** - Scale the image uniformly (maintain the image's aspect ratio) so that both dimensions (width and height) of the image will be equal to or larger than the corresponding dimension of the view (minus padding).
- `FastImage.resizeMode.stretch` - Scale width and height independently, This may change the aspect ratio of the src.
- `FastImage.resizeMode.center` - Do not scale the image, keep centered.
---
@ -200,14 +195,14 @@ Preload images to display later. e.g.
```js
FastImage.preload([
{
uri: 'https://facebook.github.io/react/img/logo_og.png',
headers: { Authorization: 'someAuthToken' },
},
{
uri: 'https://facebook.github.io/react/img/logo_og.png',
headers: { Authorization: 'someAuthToken' },
},
{
uri: 'https://facebook.github.io/react/img/logo_og.png',
headers: { Authorization: 'someAuthToken' },
},
{
uri: 'https://facebook.github.io/react/img/logo_og.png',
headers: { Authorization: 'someAuthToken' },
},
])
```
@ -236,6 +231,23 @@ It also uses Glide and SDWebImage, but didn't have some features I needed (prior
## Licenses
* FastImage - `MIT`
* SDWebImage - `MIT`
* Glide - `Apache-2.0`
- FastImage - MIT © [DylanVann](https://github.com/DylanVann)
- SDWebImage - `MIT`
- Glide - `Apache-2.0`
[build-badge]: https://img.shields.io/circleci/project/github/DylanVann/react-native-fast-image/master.svg?style=flat-square
[build]: https://circleci.com/gh/DylanVann/react-native-fast-image/tree/master
[coverage-badge]: https://img.shields.io/codecov/c/github/dylanvann/react-native-fast-image.svg?style=flat-square
[coverage]: https://codecov.io/github/dylanvann/react-native-fast-image
[downloads-badge]: https://img.shields.io/npm/dm/react-native-fast-image.svg?style=flat-square
[npmtrends]: http://www.npmtrends.com/react-native-fast-image
[package]: https://www.npmjs.com/package/react-native-fast-image
[version-badge]: https://img.shields.io/npm/v/react-native-fast-image.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/react-native-fast-image.svg?style=flat-square
[license]: https://github.com/dylanvann/react-native-fast-image/blob/master/LICENSE
[twitter]: https://twitter.com/home?status=Check%20out%20react-native-fast-image%20by%20%40atomarranger%20https%3A//github.com/DylanVann/react-native-fast-image
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/DylanVann/react-native-fast-image.svg?style=social
[github-watch-badge]: https://img.shields.io/github/watchers/dylanvann/react-native-fast-image.svg?style=social
[github-watch]: https://github.com/dylanvann/react-native-fast-image/watchers
[github-star-badge]: https://img.shields.io/github/stars/dylanvann/react-native-fast-image.svg?style=social
[github-star]: https://github.com/dylanvann/react-native-fast-image/stargazers