diff options
Replace old random-id code with incrementing id generator
Diffstat (limited to 'app/scripts/lib/random-id.js')
-rw-r--r-- | app/scripts/lib/random-id.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/scripts/lib/random-id.js b/app/scripts/lib/random-id.js new file mode 100644 index 000000000..3c5ae5600 --- /dev/null +++ b/app/scripts/lib/random-id.js @@ -0,0 +1,9 @@ +const MAX = 1000000000 + +let idCounter = Math.round( Math.random() * MAX ) +function createRandomId() { + idCounter = idCounter % MAX + return idCounter++ +} + +module.exports = createRandomId |