{"action":"created","issue":{"url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue/issues/32","repository_url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue","labels_url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue/issues/32/comments","events_url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue/issues/32/events","html_url":"https://github.com/grantcarthew/node-rethinkdb-job-queue/issues/32","id":184617947,"number":32,"title":"export constants","user":{"login":"marcoalbarelli","id":789508,"avatar_url":"https://avatars.githubusercontent.com/u/789508?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoalbarelli","html_url":"https://github.com/marcoalbarelli","followers_url":"https://api.github.com/users/marcoalbarelli/followers","following_url":"https://api.github.com/users/marcoalbarelli/following{/other_user}","gists_url":"https://api.github.com/users/marcoalbarelli/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoalbarelli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoalbarelli/subscriptions","organizations_url":"https://api.github.com/users/marcoalbarelli/orgs","repos_url":"https://api.github.com/users/marcoalbarelli/repos","events_url":"https://api.github.com/users/marcoalbarelli/events{/privacy}","received_events_url":"https://api.github.com/users/marcoalbarelli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-22T08:31:02Z","updated_at":"2016-10-22T10:57:20Z","closed_at":null,"body":"I'm at a conference so I didn't have the time to check thoroughly, but it seems like there is no clean way to retrieve constants like for instance job statuses\r\n\r\nMi current scenario is to mark a job as terminated and I resorted to hardcoding something like this:\r\n```javascript\r\njob.status = 'terminated';\r\n```\r\nI would really like best to retrieve the `terminated` string from the library\r\nOne possible way would be to expose it through the Job itself, this would turn into something like \r\n```javascript\r\njob.status = job.statuses.terminated;\r\n```\r\n\r\nAs usual if you think it's useful I'll be more than glad to provide a PR"},"comment":{"url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue/issues/comments/255521733","html_url":"https://github.com/grantcarthew/node-rethinkdb-job-queue/issues/32#issuecomment-255521733","issue_url":"https://api.github.com/repos/grantcarthew/node-rethinkdb-job-queue/issues/32","id":255521733,"user":{"login":"grantcarthew","id":572141,"avatar_url":"https://avatars.githubusercontent.com/u/572141?v=3","gravatar_id":"","url":"https://api.github.com/users/grantcarthew","html_url":"https://github.com/grantcarthew","followers_url":"https://api.github.com/users/grantcarthew/followers","following_url":"https://api.github.com/users/grantcarthew/following{/other_user}","gists_url":"https://api.github.com/users/grantcarthew/gists{/gist_id}","starred_url":"https://api.github.com/users/grantcarthew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grantcarthew/subscriptions","organizations_url":"https://api.github.com/users/grantcarthew/orgs","repos_url":"https://api.github.com/users/grantcarthew/repos","events_url":"https://api.github.com/users/grantcarthew/events{/privacy}","received_events_url":"https://api.github.com/users/grantcarthew/received_events","type":"User","site_admin":false},"created_at":"2016-10-22T10:57:20Z","updated_at":"2016-10-22T10:57:20Z","body":"I like the idea @marcoalbarelli , however seeing that JavaScript is very flexible you could end up doing this:\r\n```js\r\n\r\njob.status = job.statuses.tttterminated\r\n\r\n```\r\n\r\nAnd now the `job.statue` is `undefined`.\r\n\r\nI had this issue when I was using the sudo `enums` object I made to centralize the strings and values used within. I made the odd typo here and there and `undefined` got set to a property or status. It caused a bug and I found the issues, however it is not ideal.\r\n\r\nI see no reason why you can't simply make a statuses object in your own code which contains a subset of the statuses available. By doing that you can read the available status values in your code.\r\n"}}
{"actor":{"display_login":"grantcarthew"}}