### Start Example App Metro Server Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Starts the Metro server for the example application, enabling hot-reloading for JavaScript changes during development. Native code changes require a rebuild. ```sh yarn example start ``` -------------------------------- ### Bootstrap Project Dependencies and Pods Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Installs all project dependencies and initializes CocoaPods for the iOS development environment. This is a comprehensive setup script. ```sh yarn bootstrap ``` -------------------------------- ### Install Project Dependencies with Yarn Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Installs all the necessary dependencies for the project using Yarn. This is a foundational step for setting up the development environment. ```sh yarn ``` -------------------------------- ### Run Example App on Android Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Builds and runs the example application on an Android device or emulator. This command is used to test changes in the native Android environment. ```sh yarn example android ``` -------------------------------- ### Run Example App on iOS Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Builds and runs the example application on an iOS simulator or device. This command is used to test changes in the native iOS environment. ```sh yarn example ios ``` -------------------------------- ### Install Faster Image Package Source: https://github.com/candlefinance/faster-image/blob/main/README.md Installs the Faster Image package using Yarn. This is the initial step to integrate the library into your React Native project. ```shell yarn add @candlefinance/faster-image ``` -------------------------------- ### Cache Management and Prefetching with Faster Image Source: https://github.com/candlefinance/faster-image/blob/main/README.md Provides examples of managing the image cache and prefetching images using the utility functions provided by the '@candlefinance/faster-image' package. `clearCache` removes all cached images, while `prefetch` allows preloading images into the cache, optionally with custom headers for authenticated requests. ```javascript // Clear memory and disk cache await clearCache(); // Prefetch await prefetch(['https://picsum.photos/200/200?random=0']) // Prefetch with headers const token = 'your-token'; await prefetch(['https://picsum.photos/200/200?random=0'], { headers: { Authorization: `Bearer ${token}`, }, }); ``` -------------------------------- ### Faster Image Component Usage in React Native Source: https://github.com/candlefinance/faster-image/blob/main/README.md Demonstrates how to use the FasterImageView component in React Native. It includes example props for styling, event handling (onSuccess, onError), and image source configuration such as transition duration, border radius, cache policy, activity indicator visibility, and image URL. This snippet is written in JavaScript and relies on the '@candlefinance/faster-image' package. ```javascript import { FasterImageView, clearCache, prefetch } from '@candlefinance/faster-image'; { console.log(event.nativeEvent); }} onError={(event) => console.warn(event.nativeEvent.error)} source={{ transitionDuration: 0.3, borderRadius: 50, cachePolicy: 'discWithCacheControl', showActivityIndicator: true, url: 'https://picsum.photos/200/200?random=1', }} />; ``` -------------------------------- ### Publish New Versions with Release-it Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Publishes new versions of the package to npm using the release-it tool. This automates tasks like version bumping and tag creation. ```sh yarn release ``` -------------------------------- ### Run Unit Tests with Jest Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Executes the project's unit tests using Jest. This is crucial for verifying the correctness of individual code components. ```sh yarn test ``` -------------------------------- ### Lint Project Files with ESLint Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Runs ESLint to check for code style and potential errors according to the project's linting rules. This ensures code consistency. ```sh yarn lint ``` -------------------------------- ### Type-Check Project Files with TypeScript Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Verifies the project's code against TypeScript definitions to ensure type safety. This helps catch potential errors before runtime. ```sh yarn typecheck ``` -------------------------------- ### Fix Formatting Errors with ESLint Source: https://github.com/candlefinance/faster-image/blob/main/CONTRIBUTING.md Automatically fixes code formatting issues identified by ESLint. This command helps maintain a consistent code style across the project. ```sh yarn lint --fix ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.