chore: additional formatting w/prettier

This commit is contained in:
Cory Dransfeldt 2023-03-25 14:09:26 -07:00
parent ea75e585e1
commit ee77555c32
No known key found for this signature in database
39 changed files with 1544 additions and 1584 deletions

View file

@ -9,41 +9,41 @@ I'm still plugging away with my reading habit and my streak is now at 772 days.<
**Finished**
- [The Extended Mind by Annie Murphy Paul](https://oku.club/book/the-extended-mind-by-annie-murphy-paul-Mzlrf)
- [Drive by James S. A. Corey](https://oku.club/book/drive-by-james-s-a-corey-DXapB)
- [MBS by Ben Hubbard](https://oku.club/book/mbs-by-ben-hubbard-HTrlr)
- [Putins People by Catherine Belton](https://oku.club/book/putins-people-by-catherine-belton-cHBSw)
- [The Sins of Our Fathers by James S. A. Corey](https://oku.club/book/the-sins-of-our-fathers-by-james-s-a-corey-HKXjt)
- [The Complete Redux Book by Ilya Gelman and Boris Dinkevich](https://leanpub.com/redux-book)
- [Off the Edge by Kelly Weill](https://oku.club/book/off-the-edge-by-kelly-weill-SKujn)
- [The Cryptopians by Laura Shin](https://oku.club/book/the-cryptopians-by-laura-shin-S43ey)
- [The Intersectional Environmentalist by Leah Thomas](https://oku.club/book/the-intersectional-environmentalist-by-leah-thomas-3o8nH)
- [The Compatriots by Andrei Soldatov](https://oku.club/book/the-compatriots-by-andrei-soldatov-UMhCz)
- [The Wretched of the Earth by Frantz Fanon](https://oku.club/book/the-wretched-of-the-earth-by-frantz-fanon-8On3n)
- [Lords of Chaos by Michael Moynihan](https://oku.club/book/lords-of-chaos-by-michael-moynihan-TQeVA)
- [Going Clear by Lawrence Wright](https://oku.club/book/going-clear-by-lawrence-wright-ChtJe)
- [Blitzed by Norman Ohler](https://oku.club/book/blitzed-by-norman-ohler-CZnyf)
- [Paradise by Lizzie Johnson](https://oku.club/book/paradise-by-lizzie-johnson-BHfRA)
- [Pedagogy of the Oppressed by Paulo Freire](https://oku.club/book/pedagogy-of-the-oppressed-by-paulo-freire-nGgoW)
- [Missoula by Jon Krakauer](https://oku.club/book/missoula-by-jon-krakauer-ggUIz)
- [Free by Lea Ypi](https://oku.club/book/free-by-lea-ypi-k3V1u)
- [Reign of Terror by Spencer Ackerman](https://oku.club/book/reign-of-terror-by-spencer-ackerman-vNJMb)
- [Narconomics by Tom Wainwright](https://oku.club/book/narconomics-by-tom-wainwright-qRrxi)
- [Capitalist Realism by Mark Fisher](https://oku.club/book/capitalist-realism-by-mark-fisher-Lq4Gm)
- [An Ugly Truth by Sheera Frenkel](https://oku.club/book/an-ugly-truth-by-sheera-frenkel-RxLoN)
- [Sellout by Dan Ozzi](https://oku.club/book/sellout-by-dan-ozzi-wXvCV)
- [Will by Will Smith and Mark Manson](https://oku.club/book/will-by-will-manson-smith-mark-YfBE1)
- [The Extended Mind by Annie Murphy Paul](https://oku.club/book/the-extended-mind-by-annie-murphy-paul-Mzlrf)
- [Drive by James S. A. Corey](https://oku.club/book/drive-by-james-s-a-corey-DXapB)
- [MBS by Ben Hubbard](https://oku.club/book/mbs-by-ben-hubbard-HTrlr)
- [Putins People by Catherine Belton](https://oku.club/book/putins-people-by-catherine-belton-cHBSw)
- [The Sins of Our Fathers by James S. A. Corey](https://oku.club/book/the-sins-of-our-fathers-by-james-s-a-corey-HKXjt)
- [The Complete Redux Book by Ilya Gelman and Boris Dinkevich](https://leanpub.com/redux-book)
- [Off the Edge by Kelly Weill](https://oku.club/book/off-the-edge-by-kelly-weill-SKujn)
- [The Cryptopians by Laura Shin](https://oku.club/book/the-cryptopians-by-laura-shin-S43ey)
- [The Intersectional Environmentalist by Leah Thomas](https://oku.club/book/the-intersectional-environmentalist-by-leah-thomas-3o8nH)
- [The Compatriots by Andrei Soldatov](https://oku.club/book/the-compatriots-by-andrei-soldatov-UMhCz)
- [The Wretched of the Earth by Frantz Fanon](https://oku.club/book/the-wretched-of-the-earth-by-frantz-fanon-8On3n)
- [Lords of Chaos by Michael Moynihan](https://oku.club/book/lords-of-chaos-by-michael-moynihan-TQeVA)
- [Going Clear by Lawrence Wright](https://oku.club/book/going-clear-by-lawrence-wright-ChtJe)
- [Blitzed by Norman Ohler](https://oku.club/book/blitzed-by-norman-ohler-CZnyf)
- [Paradise by Lizzie Johnson](https://oku.club/book/paradise-by-lizzie-johnson-BHfRA)
- [Pedagogy of the Oppressed by Paulo Freire](https://oku.club/book/pedagogy-of-the-oppressed-by-paulo-freire-nGgoW)
- [Missoula by Jon Krakauer](https://oku.club/book/missoula-by-jon-krakauer-ggUIz)
- [Free by Lea Ypi](https://oku.club/book/free-by-lea-ypi-k3V1u)
- [Reign of Terror by Spencer Ackerman](https://oku.club/book/reign-of-terror-by-spencer-ackerman-vNJMb)
- [Narconomics by Tom Wainwright](https://oku.club/book/narconomics-by-tom-wainwright-qRrxi)
- [Capitalist Realism by Mark Fisher](https://oku.club/book/capitalist-realism-by-mark-fisher-Lq4Gm)
- [An Ugly Truth by Sheera Frenkel](https://oku.club/book/an-ugly-truth-by-sheera-frenkel-RxLoN)
- [Sellout by Dan Ozzi](https://oku.club/book/sellout-by-dan-ozzi-wXvCV)
- [Will by Will Smith and Mark Manson](https://oku.club/book/will-by-will-manson-smith-mark-YfBE1)
**In progress**
- [Rotting Ways to Misery by Markus Makkonen](https://oku.club/book/rotting-ways-to-misery-by-markus-makkonen-MPt17)
- [Absolution Gap by Alastair Reynolds](https://oku.club/book/absolution-gap-by-alastair-reynolds-RHAFH)
- [Moneyland by Oliver Bullough, Marianne Palm](https://oku.club/book/moneyland-by-oliver-bullough-s9wvO)
- [Rotting Ways to Misery by Markus Makkonen](https://oku.club/book/rotting-ways-to-misery-by-markus-makkonen-MPt17)
- [Absolution Gap by Alastair Reynolds](https://oku.club/book/absolution-gap-by-alastair-reynolds-RHAFH)
- [Moneyland by Oliver Bullough, Marianne Palm](https://oku.club/book/moneyland-by-oliver-bullough-s9wvO)
**Next up**
- [Miles by Miles Davis](https://oku.club/book/miles-by-miles-davis-UG9m7)
- [The Nineties by Chuck Klosterman](https://oku.club/book/the-nineties-by-chuck-klosterman-QNgHC)
- [Old Man's War by John Scalzi](https://oku.club/book/old-mans-war-by-john-scalzi-H7UHv)
- [Miles by Miles Davis](https://oku.club/book/miles-by-miles-davis-UG9m7)
- [The Nineties by Chuck Klosterman](https://oku.club/book/the-nineties-by-chuck-klosterman-QNgHC)
- [Old Man's War by John Scalzi](https://oku.club/book/old-mans-war-by-john-scalzi-H7UHv)
I've been listening to podcasts again as well, so I'll have to see how that impacts my pacing and reading.

View file

@ -12,41 +12,41 @@ A rundown of privacy tools that work well with Apple's technology ecosystem.<!--
Ubiquitous free email providers profit by mining user data (whether humans are involved or not). Your inbox acts as a key to your digital life and you should avoid using any provider that monetizes its contents.
- [Fastmail](https://ref.fm/u28939392)[^2]: based in Melbourne, Australia Fastmail offers a range of affordably priced plans with a focus on support for open standards (including active development support for [JMAP](https://jmap.io) and the [Cyrus IMAP email server](https://fastmail.blog/open-technologies/why-we-contribute/)). They also [articulate a clear commitment to protecting and respecting your privacy](https://www.fastmail.com/values/) and offer an extensive [rundown of the privacy and security measures they employ on their site](https://www.fastmail.com/privacy-and-security/).
- I would also recommend exploring their [masked email implementation](https://www.fastmail.help/hc/en-us/articles/4406536368911-Masked-Email), which integrates seamlessly with [1Password](https://1password.com) (though using 1Password isn't required).
- [mailbox.org](https://mailbox.org): based in Germany, [mailbox.org](http://mailbox.org) also has [a long history](https://mailbox.org/en/company#our-history) and [commitment to privacy](https://mailbox.org/en/company#our-mission). Their service is reliable, straightforward and fully featured (it's based off of a customized implementation [Open-Xchange](https://www.open-xchange.com)) and supports features like incoming address blocking, PGP support and so forth.
- [Proton Mail](http://protonmail.com): Proton offers a host of encrypted tools, ranging from mail to drive, calendaring and VPN services. They're also the only option in this list that includes end to end encryption. The service is extremely polished and reliable but, it's worth noting, doesn't support access to your email via open standards like IMAP/SMTP without the use of a cumbersome, desktop-only, bridge application.
- [iCloud+](https://support.apple.com/guide/icloud/icloud-overview-mmfc854d9604/icloud): if you're paying for an Apple iCloud subscription you'll get access to the option to add a custom email domain to your account to use with Apple's iCloud Mail service. This is private inasmuch as the data isn't mined for monetization against personalized ads, but is also bare-bones in terms of functionality. It supports IMAP and push notifications on Apple's devices but features like rules, aliases and so forth are extremely limited compared to the previously mentioned providers. This is better than most free providers, but hardly the best option.
- iCloud+ _does_ also offer a [Hide My Email](https://support.apple.com/guide/icloud/what-you-can-do-with-icloud-and-hide-my-email-mme38e1602db/1.0/icloud/1.0) feature to conceal your true email address, much like Fastmail.
- [Fastmail](https://ref.fm/u28939392)[^2]: based in Melbourne, Australia Fastmail offers a range of affordably priced plans with a focus on support for open standards (including active development support for [JMAP](https://jmap.io) and the [Cyrus IMAP email server](https://fastmail.blog/open-technologies/why-we-contribute/)). They also [articulate a clear commitment to protecting and respecting your privacy](https://www.fastmail.com/values/) and offer an extensive [rundown of the privacy and security measures they employ on their site](https://www.fastmail.com/privacy-and-security/).
- I would also recommend exploring their [masked email implementation](https://www.fastmail.help/hc/en-us/articles/4406536368911-Masked-Email), which integrates seamlessly with [1Password](https://1password.com) (though using 1Password isn't required).
- [mailbox.org](https://mailbox.org): based in Germany, [mailbox.org](http://mailbox.org) also has [a long history](https://mailbox.org/en/company#our-history) and [commitment to privacy](https://mailbox.org/en/company#our-mission). Their service is reliable, straightforward and fully featured (it's based off of a customized implementation [Open-Xchange](https://www.open-xchange.com)) and supports features like incoming address blocking, PGP support and so forth.
- [Proton Mail](http://protonmail.com): Proton offers a host of encrypted tools, ranging from mail to drive, calendaring and VPN services. They're also the only option in this list that includes end to end encryption. The service is extremely polished and reliable but, it's worth noting, doesn't support access to your email via open standards like IMAP/SMTP without the use of a cumbersome, desktop-only, bridge application.
- [iCloud+](https://support.apple.com/guide/icloud/icloud-overview-mmfc854d9604/icloud): if you're paying for an Apple iCloud subscription you'll get access to the option to add a custom email domain to your account to use with Apple's iCloud Mail service. This is private inasmuch as the data isn't mined for monetization against personalized ads, but is also bare-bones in terms of functionality. It supports IMAP and push notifications on Apple's devices but features like rules, aliases and so forth are extremely limited compared to the previously mentioned providers. This is better than most free providers, but hardly the best option.
- iCloud+ _does_ also offer a [Hide My Email](https://support.apple.com/guide/icloud/what-you-can-do-with-icloud-and-hide-my-email-mme38e1602db/1.0/icloud/1.0) feature to conceal your true email address, much like Fastmail.
## Email apps
- [Apple Mail](https://support.apple.com/mail): Apple's Mail app is simple but also fully featured and reliable to the point of being a bit boring. It also has enhanced privacy features as of iOS 15 and macOS 12 in the form of [Mail Privacy Protection](https://support.apple.com/guide/iphone/use-mail-privacy-protection-iphf084865c7/ios).
- [Canary Mail](https://canarymail.io/): a third-party email with a reasonable price tag and a heavy focus on privacy and security, Canary offers a number of enhancements like read receipts, templates, snoozing, PGP support and calendar/contact integration. The design hews tightly to iOS and macOS platform norms but, naturally, is not quite as tightly integrated as Apple's first-party mail app.
- [Mailmate](https://freron.com/): a long running, highly configurable mail app with a strict focus on IMAP support, Mailmate is an excellent option on macOS and also offers strong support for authoring messages in markdown.
- [Apple Mail](https://support.apple.com/mail): Apple's Mail app is simple but also fully featured and reliable to the point of being a bit boring. It also has enhanced privacy features as of iOS 15 and macOS 12 in the form of [Mail Privacy Protection](https://support.apple.com/guide/iphone/use-mail-privacy-protection-iphf084865c7/ios).
- [Canary Mail](https://canarymail.io/): a third-party email with a reasonable price tag and a heavy focus on privacy and security, Canary offers a number of enhancements like read receipts, templates, snoozing, PGP support and calendar/contact integration. The design hews tightly to iOS and macOS platform norms but, naturally, is not quite as tightly integrated as Apple's first-party mail app.
- [Mailmate](https://freron.com/): a long running, highly configurable mail app with a strict focus on IMAP support, Mailmate is an excellent option on macOS and also offers strong support for authoring messages in markdown.
## Safari extensions
- [1Blocker](https://1blocker.com): a highly configurable ad and tracker blocker. Independently maintained and actively developed it also offers a device-level firewall to block trackers embedded in other apps on your device.
- [Super Agent](https://www.super-agent.com): this extension simplifies the process of dealing with the modern web's post-GDPR flood of cookie consent banners by storing your preferences and uniformly applying them to sites that you visit. This allows you to avoid the banners altogether while limiting what's allowed to something as restrictive as, say, functional cookies only.
- [Hush](https://oblador.github.io/hush/): another option to deal with cookie banners by simply blocking the banners outright.
- [1Blocker](https://1blocker.com): a highly configurable ad and tracker blocker. Independently maintained and actively developed it also offers a device-level firewall to block trackers embedded in other apps on your device.
- [Super Agent](https://www.super-agent.com): this extension simplifies the process of dealing with the modern web's post-GDPR flood of cookie consent banners by storing your preferences and uniformly applying them to sites that you visit. This allows you to avoid the banners altogether while limiting what's allowed to something as restrictive as, say, functional cookies only.
- [Hush](https://oblador.github.io/hush/): another option to deal with cookie banners by simply blocking the banners outright.
## DNS providers
- [nextDNS](https://nextdns.io/?from=m56mt3z6): I use nextDNS on my home network for basic security and have a more restrictive configuration that heavily filters ads at the DNS level on specific devices. This allows me to block ads, trackers and other annoyances at the DNS level, which covers anything embedded in apps or other services running on my device.
- [Cloudflare 1.1.1.1](https://www.cloudflare.com/learning/dns/what-is-1.1.1.1): Cloudflare's 1.1.1.1 service doesn't offer the same features as nextDNS, but is still preferable to Google's offering or your ISP's default.
- [iCloud Private Relay](https://support.apple.com/en-us/HT212614): Another iCloud+ offering, iCloud Private Relay offers _some_ protection by relaying your traffic in Safari (and Safari only) through a pair of relays to obfuscate your actual IP address and location.
- [nextDNS](https://nextdns.io/?from=m56mt3z6): I use nextDNS on my home network for basic security and have a more restrictive configuration that heavily filters ads at the DNS level on specific devices. This allows me to block ads, trackers and other annoyances at the DNS level, which covers anything embedded in apps or other services running on my device.
- [Cloudflare 1.1.1.1](https://www.cloudflare.com/learning/dns/what-is-1.1.1.1): Cloudflare's 1.1.1.1 service doesn't offer the same features as nextDNS, but is still preferable to Google's offering or your ISP's default.
- [iCloud Private Relay](https://support.apple.com/en-us/HT212614): Another iCloud+ offering, iCloud Private Relay offers _some_ protection by relaying your traffic in Safari (and Safari only) through a pair of relays to obfuscate your actual IP address and location.
## Password managers
- [1Password:](https://1password.com): I've used 1Password for over 11 years and have yet to have any significant issues with the service. It integrates smoothly with Fastmail to generate masked email addresses, has added support for storing and generating ssh keys and application secrets, supports vault and password sharing and works across platforms. Highly recommended.[^3]
- [Bitwarden](https://bitwarden.com): I haven't made use of Bitwarden, but have heard plenty of positive feedback over the years.
- [1Password:](https://1password.com): I've used 1Password for over 11 years and have yet to have any significant issues with the service. It integrates smoothly with Fastmail to generate masked email addresses, has added support for storing and generating ssh keys and application secrets, supports vault and password sharing and works across platforms. Highly recommended.[^3]
- [Bitwarden](https://bitwarden.com): I haven't made use of Bitwarden, but have heard plenty of positive feedback over the years.
## VPN providers
- [IVPN](https://www.ivpn.net/): my current choice for a VPN provider, it's apps are modern, reliable and offer support for per network default behavior, wireguard, multihop connections and numerous endpoints around the globe.
- [Mullvad](https://mullvad.net/en/): an open source, commercial VPN based in Sweden, Mullvad offers both WireGuard and OpenVPN support.
- [Mozilla](https://www.mozilla.org/en-US/products/vpn/): offered by the non-profit Mozilla Foundation, this is another compelling offering from an organization with a track record of fighting for the open web and preserving user privacy.
- [IVPN](https://www.ivpn.net/): my current choice for a VPN provider, it's apps are modern, reliable and offer support for per network default behavior, wireguard, multihop connections and numerous endpoints around the globe.
- [Mullvad](https://mullvad.net/en/): an open source, commercial VPN based in Sweden, Mullvad offers both WireGuard and OpenVPN support.
- [Mozilla](https://www.mozilla.org/en-US/products/vpn/): offered by the non-profit Mozilla Foundation, this is another compelling offering from an organization with a track record of fighting for the open web and preserving user privacy.
For now I've scoped this post to platforms and tools that are central to maintaining your online privacy. But, with that said, each app you use should be examined to determine if and how it fits with your approach towards privacy.

View file

@ -62,13 +62,13 @@ For example, to clear old newsletters, I use the following:
```javascript
function batchDeleteEmail() {
var SEARCH_QUERY = 'label:newsletters -label:inbox'
var batchSize = 100
var searchSize = 400
var threads = GmailApp.search(SEARCH_QUERY, 0, searchSize)
for (j = 0; j < threads.length; j += batchSize) {
GmailApp.moveThreadsToTrash(threads.slice(j, j + batchSize))
}
var SEARCH_QUERY = 'label:newsletters -label:inbox'
var batchSize = 100
var searchSize = 400
var threads = GmailApp.search(SEARCH_QUERY, 0, searchSize)
for (j = 0; j < threads.length; j += batchSize) {
GmailApp.moveThreadsToTrash(threads.slice(j, j + batchSize))
}
}
```
@ -92,13 +92,13 @@ Unrelated to cleanup, I also mark any unread emails in my archive as read, with
```javascript
function markArchivedAsRead() {
var SEARCH_QUERY = 'label:unread -label:inbox'
var batchSize = 100
var searchSize = 400
var threads = GmailApp.search(SEARCH_QUERY, 0, searchSize)
for (j = 0; j < threads.length; j += batchSize) {
GmailApp.markThreadsRead(threads.slice(j, j + batchSize))
}
var SEARCH_QUERY = 'label:unread -label:inbox'
var batchSize = 100
var searchSize = 400
var threads = GmailApp.search(SEARCH_QUERY, 0, searchSize)
for (j = 0; j < threads.length; j += batchSize) {
GmailApp.markThreadsRead(threads.slice(j, j + batchSize))
}
}
```

View file

@ -38,8 +38,8 @@ These will be specific to your domain and can be found and set as follows:
**Bonus points**
- Configure DMARC — Simon Andrews has [an excellent writeup](https://simonandrews.ca/articles/how-to-set-up-spf-dkim-dmarc#dmarc)on how to do this.
- Configure MTA-STS — there's a writeup on that [over at dmarcian](https://dmarcian.com/mta-sts/). It'll entail configuring an additional 3 DNS records and exposing an MTA-STS policy file[^6].
- Configure DMARC — Simon Andrews has [an excellent writeup](https://simonandrews.ca/articles/how-to-set-up-spf-dkim-dmarc#dmarc)on how to do this.
- Configure MTA-STS — there's a writeup on that [over at dmarcian](https://dmarcian.com/mta-sts/). It'll entail configuring an additional 3 DNS records and exposing an MTA-STS policy file[^6].
### Importing your email
@ -63,17 +63,17 @@ Hop on over to Fastmail's [folder documentation](https://www.fastmail.help/hc/en
I would highly recommend creating rulesets to help filter messages that aren't critical out of your inbox. Fastmail's documentation on their mail rules and filters [can be found here](https://www.fastmail.help/hc/en-us/articles/1500000278122-Organizing-your-inbox#rules). I filter messages out of my inbox based on a few broad categories, namely:
- **Updates:** anything sent programmatically and pertinent but not critical (e.g. service or utility notifications and so forth).
- **Financial:** anything from financial institutions. I do this based on the TLD, e.g. `examplebank.com`.
- **Social:** anything from social networks or services. I do this based on the TLD, e.g. `linkedin.com`.
- **Promotions:** anything from a merchant or similar mailing list. I subscribe to a handful but don't want them in my inbox. I use [Fastmail's advanced folder options](https://www.fastmail.help/hc/en-us/articles/1500000280301-Setting-up-and-using-folders) to auto-purge this folder every 60 days.
- **Updates:** anything sent programmatically and pertinent but not critical (e.g. service or utility notifications and so forth).
- **Financial:** anything from financial institutions. I do this based on the TLD, e.g. `examplebank.com`.
- **Social:** anything from social networks or services. I do this based on the TLD, e.g. `linkedin.com`.
- **Promotions:** anything from a merchant or similar mailing list. I subscribe to a handful but don't want them in my inbox. I use [Fastmail's advanced folder options](https://www.fastmail.help/hc/en-us/articles/1500000280301-Setting-up-and-using-folders) to auto-purge this folder every 60 days.
I also use a few aliases to route mail elsewhere:
- **Deliveries:** anything referencing tracking numbers or shipment status get sent off to [Parcel](https://parcelapp.net).
- **Alerts:** uptime alerts and a few other notifications get sent off to [Things](https://culturedcode.com/things/) to be slotted as actionable tasks to be addressed.
- **Newsletters:** mailing lists get routed off to [Feedbin](https://feedbin.com) to be read (or not).
- **Reports:** I route DMARC/email reports to this folder in the event I need to review them (which is rarely if ever).
- **Deliveries:** anything referencing tracking numbers or shipment status get sent off to [Parcel](https://parcelapp.net).
- **Alerts:** uptime alerts and a few other notifications get sent off to [Things](https://culturedcode.com/things/) to be slotted as actionable tasks to be addressed.
- **Newsletters:** mailing lists get routed off to [Feedbin](https://feedbin.com) to be read (or not).
- **Reports:** I route DMARC/email reports to this folder in the event I need to review them (which is rarely if ever).
All of these particular folders live as children of my Archive folder and are auto-purged at different intervals. They're messages that are useful in the near term but whose utility falls off pretty quickly over time.

View file

@ -21,22 +21,22 @@ import { useEffect, useState } from 'react'
import useSWR from 'swr'
export const useRss = (url: string) => {
const [response, setResponse] = useState([])
const [response, setResponse] = useState([])
const fetcher = (url: string) =>
read(url)
.then((res) => res.entries)
.catch()
const { data, error } = useSWR(url, fetcher)
const fetcher = (url: string) =>
read(url)
.then((res) => res.entries)
.catch()
const { data, error } = useSWR(url, fetcher)
useEffect(() => {
setResponse(data)
}, [data, setResponse])
useEffect(() => {
setResponse(data)
}, [data, setResponse])
return {
response,
error,
}
return {
response,
error,
}
}
```
@ -53,22 +53,22 @@ import { useEffect, useState } from 'react'
import useSWR from 'swr'
export const useJson = (url: string) => {
const [response, setResponse] = useState<any>({})
const [response, setResponse] = useState<any>({})
const fetcher = (url: string) =>
fetch(url)
.then((res) => res.json())
.catch()
const { data, error } = useSWR(url, fetcher)
const fetcher = (url: string) =>
fetch(url)
.then((res) => res.json())
.catch()
const { data, error } = useSWR(url, fetcher)
useEffect(() => {
setResponse(data)
}, [data, setResponse])
useEffect(() => {
setResponse(data)
}, [data, setResponse])
return {
response,
error,
}
return {
response,
error,
}
}
```