2016-08-10 21:36:11 +02:00
|
|
|
/**
|
|
|
|
* This file defines entities storage models.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// NPM imports
|
|
|
|
import Immutable from "immutable";
|
|
|
|
|
|
|
|
/** Record to store the shared entities. */
|
|
|
|
export const stateRecord = new Immutable.Record({
|
|
|
|
isFetching: false, /** Whether API fetching is in progress */
|
|
|
|
error: null, /** An error string */
|
|
|
|
refCounts: new Immutable.Map({
|
|
|
|
album: new Immutable.Map(),
|
|
|
|
artist: new Immutable.Map(),
|
2016-08-10 23:50:23 +02:00
|
|
|
song: new Immutable.Map(),
|
2016-08-10 21:36:11 +02:00
|
|
|
}), /** Map of id => reference count for each object type (garbage collection) */
|
|
|
|
entities: new Immutable.Map({
|
|
|
|
album: new Immutable.Map(),
|
|
|
|
artist: new Immutable.Map(),
|
2016-08-10 23:50:23 +02:00
|
|
|
song: new Immutable.Map(),
|
|
|
|
}), /** Map of id => entity for each object type */
|
2016-08-10 21:36:11 +02:00
|
|
|
});
|