cherif_b
cherif_b
SSolidJS
Created by cherif_b on 8/14/2023 in #support
Signal cross bound a route
Hi, I'm new to Solidjs, I wonder if there's a way to make a solid-router to cross bound a signal? I try to make a emails client app, let's say I have folders for: inbox, sent, trash, later those folders are router link and I have emails list, each email is organized in multiple folders, my signals are lifted in the app component like the following:
const [folders, setFolders] = createSignal(availableFolders);
const [currentFolder, setCurrentFolder] = createSignal("inbox");
const [emails, setEmails] = createSignal(allEmails);
const folderEmails = () => emails().filter(email => {
return email.folders.indexOf(currentFolder()) > -1
});
const navigate = useNavigate();
navigate(currentFolder());
const [folders, setFolders] = createSignal(availableFolders);
const [currentFolder, setCurrentFolder] = createSignal("inbox");
const [emails, setEmails] = createSignal(allEmails);
const folderEmails = () => emails().filter(email => {
return email.folders.indexOf(currentFolder()) > -1
});
const navigate = useNavigate();
navigate(currentFolder());
I need to change the current folder whenever the folder changes in the route and vice versa.
8 replies