stores.js 354 B

123456789101112131415
  1. import queryString from "query-string";
  2. import { writable, derived } from 'svelte/store';
  3. const live = writable(false);
  4. const channel = writable('offtopic');
  5. if (typeof window !== "undefined") {
  6. const parsed = queryString.parse(window.location.search);
  7. if(parsed.channel){
  8. channel.set(parsed.channel)
  9. }
  10. }
  11. export { live, channel}