Open RubenVerborgh opened 1 year ago
We could also just return an AsyncIterator
in getIdentityProviderList
, which would then expose the toArray()
method with optional limit
.
Ah right, you were thinking AsyncIterator
; I was thinking native asynchronous iterator. Either is fine with me.
Ok, let's go with AsyncIterator
then for now.
Once we implement https://github.com/RubenVerborgh/AsyncIterator/issues/89, we'll get the best of both worlds :-)
There is no bound on the number of IDPs a person can have; the fact that it is currently often 1 is random. Let's also add a
getIdps
(andgetIdentityProviders
https://github.com/SolidLabResearch/SolidLabLib.js/issues/9) function that returns an array (with limit? or async iterator?); thengetIdp
just takes the first of that.I wonder if we want to anticipate on the generic problem that some lists can be slow/long/infinite, and expose both
getIdentityProviders
(async iterator) andgetIdentityProviderList(limit = 10)
(array). Where we have a generic functiongetIdentityProviderList = generatorToArray(getIdentityProviders)
, and we reusegeneratorToArray
.