diff --git a/package.json b/package.json
index a45df1d..d21e0a8 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,8 @@
"lit-html": "^0.9.0",
"pwa-helpers": "PolymerLabs/pwa-helpers",
"redux-thunk": "^2.2.0",
- "reselect": "^3.0.1"
+ "reselect": "^3.0.1",
+ "virtual-list": "github:PolymerLabs/virtual-list#master"
},
"devDependencies": {
"polyserve": "^0.25.2"
diff --git a/src/components/hn-item.js b/src/components/hn-item.js
index d1405fb..e1f629c 100644
--- a/src/components/hn-item.js
+++ b/src/components/hn-item.js
@@ -9,7 +9,8 @@
*/
import { LitElement, html } from '../../node_modules/@polymer/lit-element/lit-element.js';
-import { repeat } from '../../node_modules/lit-html/lib/repeat.js';
+import { verticalList } from '../../node_modules/virtual-list/lit-html/lit-list.js';
+import Layout from '../../node_modules/virtual-list/layouts/layout-1d.js';
import { unsafeHTML } from '../../node_modules/lit-html/lib/unsafe-html.js';
import { connect } from '../../node_modules/pwa-helpers/connect-mixin.js';
import { fetchItem, fetchItemIfNeeded } from '../actions/items.js';
@@ -29,6 +30,12 @@ store.addReducers({
store.dispatch(loadFavorites());
+const layout = new Layout({
+ itemSize: {
+ y: 2000
+ }
+});
+
export class HnItemElement extends connect(store)(LitElement) {
render({ favorites, item }) {
const comments = item.comments || [];
@@ -40,21 +47,21 @@ export class HnItemElement extends connect(store)(LitElement) {
border-bottom: 1px solid #e5e5e5;
}
-
Item not found
` : ''} +