Skip to content

Commit

Permalink
remove requestAnimationFrame polyfill (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
naqvitalha authored and muskeinsingh committed Jul 17, 2018
1 parent 4cfe9d9 commit 2ca3b04
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ For full feature set have a look at prop definitions of [RecyclerListView](https
* **[Sample Code](https://github.com/Flipkart/recyclerlistview/tree/master/docs/guides/samplecode)**
* **[Performance](https://github.com/Flipkart/recyclerlistview/tree/master/docs/guides/performance)**
* **Web Support:** Works with React Native Web out of the box. For use with ReactJS start importing from `recyclerlistview/web` e.g., `import { RecyclerListView } from "recyclerlistview/web"`. Use aliases if you want to preserve import path. Only platform specific code is part of the build so, no unnecessary code will ship with your app.
* **Polyfills Needed:** `requestAnimationFrame`

## License
**[Apache v2.0](https://github.com/Flipkart/recyclerlistview/blob/master/LICENSE.md)**
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "recyclerlistview",
"version": "1.4.0-beta.7",
"version": "1.4.0-beta.9",
"description": "The listview that you need and deserve. It was built for performance, uses cell recycling to achieve smooth scrolling.",
"main": "dist/reactnative/index.js",
"types": "dist/reactnative/index.d.ts",
Expand Down
5 changes: 2 additions & 3 deletions src/core/ProgressiveListView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import RecyclerListView, { RecyclerListViewProps, RecyclerListViewState } from "./RecyclerListView";
import { pRequestAnimationFrame, pCancelAnimationFrame } from "../utils/JavascriptPolyfill";
export interface ProgressiveListViewProps extends RecyclerListViewProps {
maxRenderAhead?: number;
renderAheadStep?: number;
Expand All @@ -25,7 +24,7 @@ export default class ProgressiveListView extends RecyclerListView<ProgressiveLis

private updateRenderAheadProgessively(newVal: number): void {
this.cancelRenderAheadUpdate(); // Cancel any pending callback.
this.renderAheadUdpateCallbackId = pRequestAnimationFrame(() => {
this.renderAheadUdpateCallbackId = requestAnimationFrame(() => {
if (!this.updateRenderAheadOffset(newVal)) {
this.updateRenderAheadProgessively(newVal);
} else {
Expand All @@ -51,7 +50,7 @@ export default class ProgressiveListView extends RecyclerListView<ProgressiveLis

private cancelRenderAheadUpdate(): void {
if (this.renderAheadUdpateCallbackId) {
pCancelAnimationFrame(this.renderAheadUdpateCallbackId);
cancelAnimationFrame(this.renderAheadUdpateCallbackId);
}
}
}
7 changes: 0 additions & 7 deletions src/utils/JavascriptPolyfill.ts

This file was deleted.

0 comments on commit 2ca3b04

Please sign in to comment.