- implementing immutable.js
This commit is contained in:
16
app/domain/Auction.js
Normal file
16
app/domain/Auction.js
Normal 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,
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user