Last active
July 3, 2017 15:23
-
-
Save asvae/9d64a1ea2feaff2070da5fd16c9761db to your computer and use it in GitHub Desktop.
Country store
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import CountryRepository from '../classes/Api/CountryRepository.js' | |
import Country from "../classes/Domain/Entity/Country"; | |
export default { | |
_isInitialized: false, | |
_countries: [], | |
get countries (): Array<Country> { | |
if (!this._isInitialized) { | |
this._isInitialized = true | |
this._loadCountries() | |
} | |
return this._countries | |
}, | |
async _loadCountries () { | |
this._countries = await CountryRepository.getAll() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment