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