Permalink
Browse files

Add toJSON() methods to Redux-ORM model classes

  • Loading branch information...
markerikson committed Jan 22, 2017
1 parent 57b924c commit 6376ebd0dc2ca9b0d1cb48c77f09f3eb9878d5f3
Showing with 12 additions and 0 deletions.
  1. +4 −0 src/features/mechs/Mech.js
  2. +4 −0 src/features/mechs/MechDesign.js
  3. +4 −0 src/features/pilots/Pilot.js
@@ -12,6 +12,10 @@ export default class Mech extends Model {
static parse(mechData) {
return this.create(mechData);
}
toJSON() {
return {...this.ref};
}
}
Mech.modelName = "Mech";
@@ -4,6 +4,10 @@ export default class MechDesign extends Model {
static parse(designData) {
return this.create(designData);
}
toJSON() {
return {...this.ref};
}
}
MechDesign.modelName = "MechDesign";
@@ -17,6 +17,10 @@ export default class Pilot extends Model {
// class itself, not an instance
return this.create(pilotData);
}
toJSON() {
return {...this.ref};
}
}
Pilot.modelName = "Pilot";

0 comments on commit 6376ebd

Please sign in to comment.