Pocket / extension-save-to-pocket

Save to Pocket is a browser extension that is used to save pages to a connected Pocket account
https://getpocket.com
MIT License
274 stars 48 forks source link

refactor(auth): idiomatic asynchronous dispatch #108

Closed nzeltzer closed 5 years ago

nzeltzer commented 5 years ago

Goal

Use idiomatic asynchronous dispatch to avoid blocking the main CPU thread

Todos:

Implementation Decisions

The refactor of API.request makes it consistent with idiomatic Swift (insomuch as I know anything about Swift). In the API.validateAuthCode function, I created an example of how one can use a dedicated dispatch queue to use dispatch semaphores without blocking the main queue.

All Submissions: