Last active
June 7, 2016 14:47
-
-
Save prenaudin/f1cad2bda2f2334459f8b006449c91e4 to your computer and use it in GitHub Desktop.
Immutable.Record + React + Redux = ❤ - 1
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 Immutable from 'immutable'; | |
const TaskRecord = Immutable.Record({ | |
id: null, | |
done: false, | |
label: '', | |
createdAt: null, | |
updatedAt: null, | |
}) | |
class Task extends TaskRecord { | |
isDone() { | |
return this.get('done'); | |
} | |
getLabel() { | |
return this.get('label') || 'New Task'; | |
} | |
} | |
export default Task; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment