Skip to content

Instantly share code, notes, and snippets.

@prenaudin
Last active June 7, 2016 14:47
Show Gist options
  • Save prenaudin/f1cad2bda2f2334459f8b006449c91e4 to your computer and use it in GitHub Desktop.
Save prenaudin/f1cad2bda2f2334459f8b006449c91e4 to your computer and use it in GitHub Desktop.
Immutable.Record + React + Redux = ❤ - 1
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