Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cooler useProfiles with localstorage #21

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

chdwlch
Copy link
Collaborator

@chdwlch chdwlch commented Mar 22, 2023

This method uses Dexie, a wrapper for IndexedDB and SimplePool from nostr-tools

Pros vs nostr-react:

  1. saves in localstorage, really fast loads on refresh etc.
  2. SimplePool allows us to use specific relays for specific operations (i.e. might want a lot of relays for fetching profile metadatas)
  3. better handling of the latest 'created_at' profiles than nostr-react (doesn't flicker profile name/image as much because now it doesn't use the latest profile metadata returned by really...)

I made a demo at http://localhost:3000/testProfiles if you want to try it

@netlify
Copy link

netlify bot commented Mar 22, 2023

Deploy Preview for superlative-biscotti-9be5a4 failed.

Name Link
🔨 Latest commit 8d07e72
🔍 Latest deploy log https://app.netlify.com/sites/superlative-biscotti-9be5a4/deploys/641b6aca981bed0008f5b4f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant