mirror of
https://github.com/zoriya/vex.git
synced 2026-05-25 15:40:44 +00:00
Comment PR fix
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
// /home/cbihan/Documents/front_stuff/vex/web/src/lib/stores/post.store.js
|
||||
import type { Post } from "$lib/types";
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
// Initial state
|
||||
const initialState: Post[] = [];
|
||||
|
||||
// Create the writable store
|
||||
export const postStore = writable<Post[]>(initialState);
|
||||
|
||||
// Actions
|
||||
export const addPost = (post: Post) => {
|
||||
postStore.update((posts) => [...posts, post]);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user