Permalink
Browse files

feat(entity): Added .isNew() method

  • Loading branch information...
RWOverdijk committed Dec 28, 2015
1 parent e2bb595 commit 884ec0518ab4659102e0b7636fdcadec2f961032
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/entity.js
@@ -101,6 +101,15 @@ export class Entity {
return !this.isClean();
}
/**
* Return if the entity is new (ergo, hasn't been persisted to the server).
*
* @return {boolean}
*/
isNew() {
return typeof this.id === 'undefined';
}
/**
* Persist the changes made to this entity to the server.
*

0 comments on commit 884ec05

Please sign in to comment.