Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let getWallpaper = (term) => {
- const config = {
- "method": "GET"
- }
- const CLIENT_ID = '';
- const url = `https://api.unsplash.com/photos/random?query=${term}&client_id=${CLIENT_ID}`;
- fetch(url, config)
- .then(response => {
- response.json()
- .then(data => {
- return data.urls.regular;
- })
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement