- implementing immutable.js

This commit is contained in:
2019-07-17 03:21:23 -04:00
parent 8ecf036cc4
commit 434a1ded24
39 changed files with 1123 additions and 187 deletions

16
app/domain/Auction.js Normal file
View File

@@ -0,0 +1,16 @@
import { Record } from 'immutable';
export default class Auction extends Record({
id: null,
bidCount: 0,
isBidding: false,
isWinning: false,
itemPrice: 0,
}) {}
Auction.fromJS = (data = {}) => {
return new Auction({
id: data._id,
...data,
});
};