November 2019
Beginner
804 pages
20h 1m
English
This method will simply return an array containing all the keys in the store. This will come in handy later when we work on the UI, in order to allow us to load the existing collections.
The following is the relevant code:
getMediaCollectionIdentifiersList(): Promise<string[]> {
return new Promise<string[]>((resolve, reject) => {
console.log("Retrieving the list of media collection identifiers");
this._store.keys().then(keys => {
console.log(`Retrieved the of media collection identifiers: ${keys}`);
resolve(keys);
})
.catch(err => {
console.error(`Failed to retrieve the list of media collection identifiers. Error: ${err}`);
reject(err);
})
});
}
This is, of course, very similar ...
Read now
Unlock full access