]> git.r.bdr.sh - rbdr/lgtm/blame - src/lib/stores/lgtm.js
Port to svelte
[rbdr/lgtm] / src / lib / stores / lgtm.js
CommitLineData
92ccd82c
RBR
1import { readable } from 'svelte/store';
2import lgtmList from '$lib/lgtm_list';
3
4const internals = {
5 random(list) {
6
7 return list[Math.floor(Math.random() * list.length)];
8 }
9};
10
11export const getLGTM = function () {
12
13 return readable(internals.random(lgtmList));
14};