@@ -59,9 +66,21 @@ class Feed extends React.Component {
{error &&
Connection error?
}
{stories ? stories.map(story =>
) :
loading...
}
+
+
+ {Number(skip) > 0 && Previous}
+ {stories.length == Number(limit) && Next}
+
);
}
}
+Feed.key = function (props) {
+ const query = new URLSearchParams(props.location.search);
+ const skip = query.get('skip') || 0;
+ const limit = query.get('limit') || 20;
+ return `skip=${skip}&limit=${limit}`;
+}
+
export default Feed;