DraganovicDr
DraganovicDr
TTCTheo's Typesafe Cult
Created by DraganovicDr on 11/27/2023 in #questions
Seeking Advice for a T3 Stack Application: Separating tRPC from NextJS
But I still don't understand how ReactNative can access the API, as far as I know NextJS doesn't expose it's API to the public
14 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 11/27/2023 in #questions
Seeking Advice for a T3 Stack Application: Separating tRPC from NextJS
Reading a bit about tRPC I found that it doesn't produce normal Rest API endpoints so now I'm thinking about using Hono instead, but I don't know if Hono plays well with ReactQuery or if they have something similar.
14 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 11/27/2023 in #questions
Seeking Advice for a T3 Stack Application: Separating tRPC from NextJS
I want the backend api to be separate cause it's going to be used by many other applications not only the NextJS app
14 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 11/27/2023 in #questions
Seeking Advice for a T3 Stack Application: Separating tRPC from NextJS
Yes
14 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 1/20/2023 in #questions
Zustand Electron Middleware
6 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 1/20/2023 in #questions
Zustand Electron Middleware
6 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 1/20/2023 in #questions
Zustand Electron Middleware
import { create } from 'zustand';
import { devtools } from 'zustand/middleware';
import electronSync from './electronMiddleware';

type FishState = {
fish: number;
increasePopulation: () => void;
removeAllFish: () => void;
};

export const useFishStore = create<FishState, [['zustand/devtools', never]]>(
electronSync(
devtools(
(set) => ({
fish: 0,
increasePopulation: () =>
set(
(state) => ({ fish: state.fish + 1 }),
false,
'increasePopulation'
),
removeAllFish: () => set({ fish: 0 }),
}),
{
name: 'Fish Store',
}
),
{ key: 'fish-store', excludes: [] }
)
);

export default useFishStore;
import { create } from 'zustand';
import { devtools } from 'zustand/middleware';
import electronSync from './electronMiddleware';

type FishState = {
fish: number;
increasePopulation: () => void;
removeAllFish: () => void;
};

export const useFishStore = create<FishState, [['zustand/devtools', never]]>(
electronSync(
devtools(
(set) => ({
fish: 0,
increasePopulation: () =>
set(
(state) => ({ fish: state.fish + 1 }),
false,
'increasePopulation'
),
removeAllFish: () => set({ fish: 0 }),
}),
{
name: 'Fish Store',
}
),
{ key: 'fish-store', excludes: [] }
)
);

export default useFishStore;
6 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 1/20/2023 in #questions
Zustand Electron Middleware
Here is an example:
6 replies
TTCTheo's Typesafe Cult
Created by DraganovicDr on 1/20/2023 in #questions
Zustand Electron Middleware
I think I cracked it
6 replies