Skip to content
Browse files

shorter id

  • Loading branch information...
1 parent a9f88e5 commit a9ba7b03ad8a968769b1e29eaddb67ef3b4971c5 @dominictarr dominictarr committed Nov 11, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 model.js
View
6 model.js
@@ -2,14 +2,14 @@ var crdt = require('crdt')
var model = module.exports = new (crdt.Doc)
var ids = 1
-function uuid () {
- return ids++
+function id (type) {
+ return type+'_'+ids++
}
model.create = function (type) {
console.log('create', type)
var row = model.add({
- id: type + '_' + uuid()
+ id: id(type)
, x: Math.round(Math.random() * 600)
, y: Math.round(Math.random() * 480)
, type: type

0 comments on commit a9ba7b0

Please sign in to comment.
Something went wrong with that request. Please try again.