X-Git-Url: https://git.r.bdr.sh/rbdr/forum/blobdiff_plain/00a6e8aa8dd06f8a2bd7ccccdccfcb6215cf4841..3841606684ee3d233266ad490905076a3562842c:/app/stores/forums.js?ds=sidebyside diff --git a/app/stores/forums.js b/app/stores/forums.js index c473124..1928783 100644 --- a/app/stores/forums.js +++ b/app/stores/forums.js @@ -1,4 +1,5 @@ -import { writable } from 'svelte/store'; +import { readable } from 'svelte/store'; +import { onMessage } from '../socket_coordinator'; const internals = {}; @@ -70,17 +71,10 @@ internals.forums = [ } ]; -export const forums = writable(internals.forums); +export const forums = readable(internals.forums, (set) => { -export const addForum = function addForum() { + onMessage((message) => { - const id = Math.random(); - - forums.update((originalForums) => ([...originalForums, - { - id, - glyph: 'の', - label: `Woah ${id}` - } - ])); -}; + console.log(message, typeof message); + }); +});