Last active
June 23, 2020 12:05
-
-
Save tobiu/f24ba2f2eaaa9910c46c5b14206e9720 to your computer and use it in GitHub Desktop.
How to create a webworkers driven multithreading App - Part 2 - VI
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 Model from '../../../node_modules/neo.mjs/src/data/Model.mjs'; | |
/** | |
* @class Covid.model.Country | |
* @extends Neo.data.Model | |
*/ | |
class Country extends Model { | |
static getConfig() {return { | |
className: 'Covid.model.Country', | |
fields: [{ | |
name: 'active', | |
type: 'Integer' | |
}, { | |
name: 'cases', | |
type: 'Integer' | |
}, { | |
name: 'casesPerOneMillion', | |
type: 'Integer' | |
}, { | |
name: 'country', | |
type: 'String' | |
}, { | |
name: 'countryInfo', | |
type: 'Object' // _id, flag, iso2, iso3, lat, long | |
}, { | |
name: 'critical', | |
type: 'Integer' | |
}, { | |
name: 'deaths', | |
type: 'Integer' | |
}, { | |
name: 'index', | |
type: 'Integer' | |
}, { | |
name: 'infected', // renderer parses to % of population | |
type: 'Integer' | |
}, { | |
name: 'recovered', | |
type: 'Integer' | |
}, { | |
name: 'tests', | |
type: 'Integer' | |
}, { | |
name: 'testsPerOneMillion', | |
type: 'Integer' | |
}, { | |
name: 'todayCases', | |
type: 'Integer' | |
}, { | |
name: 'todayDeaths', | |
type: 'Integer' | |
}] | |
}} | |
} | |
Neo.applyClassConfig(Country); | |
export {Country as default}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment