Skip to content

Commit

Permalink
move waitAsync outside of component
Browse files Browse the repository at this point in the history
  • Loading branch information
ammarahm-ed committed Apr 22, 2020
1 parent 7f13853 commit 56cf387
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ const testNativeAd = {
images: ["https://dummyimage.com/qvga"],
};

const waitAsync = (ms) =>
new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, ms);
});

const NativeAdView = (props) => {
const [nativeAd, setNativeAd] = useState(null);
const [forceRefresh, setForceRefresh] = useState(false);
Expand Down Expand Up @@ -77,13 +84,6 @@ const NativeAdView = (props) => {
}
}, [props.enableTestMode]);

const waitAsync = (ms) =>
new Promise((resolve, reject) => {
setTimeout(() => {
resolve(true);
}, ms);
});

useEffect(() => {
if (props.delayAdLoading) {
delayAdLoadBy = props.delayAdLoading;
Expand Down

0 comments on commit 56cf387

Please sign in to comment.