new FavoritesStore()
- Mixes In:
- OO.EventEmitter
- Source:
Methods
addFavorite(pageId) → {Promise}
Add a page ID to the favorites array
Parameters:
| Name | Type | Description |
|---|---|---|
pageId |
string |
Returns:
Resolves when the page ID is added (or is not able to be).
- Type
- Promise
getAllFavoritesDetails() → {Promise}
Returns:
- Type
- Promise
getFavoritesDetails(pageIds) → {Promise}
Get the details of some favorites by page ID.
Parameters:
| Name | Type | Description |
|---|---|---|
pageIds |
Array.<(number|string)> |
Returns:
- Type
- Promise
isFavorite(pageId) → {boolean}
Check if a page ID is in the favorites array
Parameters:
| Name | Type | Description |
|---|---|---|
pageId |
string |
Returns:
Whether the page ID is in the favorites array
- Type
- boolean
removeFavorite(pageId) → {Promise}
Remove a page ID from the favorites array
Parameters:
| Name | Type | Description |
|---|---|---|
pageId |
string |
Returns:
Resolves when the page ID is removed (or is not able to be).
- Type
- Promise
saveFavoritesArray(favoritesArray) → {Promise}
Save the favorites array to the user options
Parameters:
| Name | Type | Description |
|---|---|---|
favoritesArray |
Array |
Returns:
- Type
- Promise