@frontity/mars-theme
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.3.4](https://github.com/frontity/frontity/compare/@frontity/mars-theme@0.3.3...@frontity/mars-theme@0.3.4) (2019-05-17) | ||
### Bug Fixes | ||
* **mars-theme:** use useEffect for prefetching ([f81c84d](https://github.com/frontity/frontity/commit/f81c84d)) | ||
## [0.3.3](https://github.com/frontity/frontity/compare/@frontity/mars-theme@0.3.2...@frontity/mars-theme@0.3.3) (2019-05-17) | ||
@@ -8,0 +19,0 @@ |
{ | ||
"name": "@frontity/mars-theme", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "A starter theme for Frontity", | ||
@@ -21,12 +21,8 @@ "keywords": [ | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"devDependencies": { | ||
"@frontity/connect": "^0.1.2", | ||
"@frontity/router": "^0.1.3", | ||
"@frontity/source": "^0.1.2", | ||
"frontity": "^0.2.10" | ||
"frontity": "^0.2.11" | ||
}, | ||
"gitHead": "4f1c07acab271d0c4d5758974b2ab52be6c56a23" | ||
"gitHead": "d3e8804d373fc908d88faee8201f8b845ce5bf52" | ||
} |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import React, { useEffect } from "react"; | ||
import { connect } from "frontity"; | ||
@@ -11,7 +11,9 @@ import Link from "../link"; | ||
// Fetch the next page if it hasn't been fetched yet. | ||
if (state.router.page < totalPages) | ||
actions.source.fetch({ | ||
path: state.router.path, | ||
page: state.router.page + 1 | ||
}); | ||
useEffect(() => { | ||
if (state.router.page < totalPages) | ||
actions.source.fetch({ | ||
path: state.router.path, | ||
page: state.router.page + 1 | ||
}); | ||
}, []); | ||
@@ -18,0 +20,0 @@ return ( |
@@ -1,2 +0,2 @@ | ||
import React from "react"; | ||
import React, { useEffect } from "react"; | ||
import { connect, styled } from "frontity"; | ||
@@ -15,4 +15,6 @@ import List from "./list"; | ||
// Prefetch home posts and the list component. | ||
actions.source.fetch("/"); | ||
List.preload(); | ||
useEffect(() => { | ||
actions.source.fetch("/"); | ||
List.preload(); | ||
}, []); | ||
@@ -19,0 +21,0 @@ return data.isReady ? ( |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
25491
3
448
1