Skip to content

Instantly share code, notes, and snippets.

@tobiu
Last active June 23, 2020 12:05
Show Gist options
  • Save tobiu/f24ba2f2eaaa9910c46c5b14206e9720 to your computer and use it in GitHub Desktop.
Save tobiu/f24ba2f2eaaa9910c46c5b14206e9720 to your computer and use it in GitHub Desktop.
How to create a webworkers driven multithreading App - Part 2 - VI
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