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

fetchURL() should be named differently #2

Open
LeaVerou opened this issue May 5, 2023 · 1 comment
Open

fetchURL() should be named differently #2

LeaVerou opened this issue May 5, 2023 · 1 comment

Comments

@LeaVerou
Copy link

LeaVerou commented May 5, 2023

It's confusing that there is a $gf.media.fetch() and a $gf.media.fetchURL(), since the former also returns a (blob) URL.

Brainstorming:

  • toURL()
  • getURL()
  • getBlobURL()
  • toObjectURL()
  • getObjectURL()
  • createObjectURL() (to parallel the native method, since this seems to be a thin abstraction over it)
@sportdeath
Copy link
Collaborator

The first just returns a Blob, not a URL.

$gf.media.fetchURL() is essentially:

URL.createObjectURL(await $gf.media.fetch(...))

plus some caching to prevent generating multiple URLs that point to the same Blob.

Maybe $gf.media.fetchObjectURL()?

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

No branches or pull requests

2 participants