Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

create-function-middleware.ts

15 lines287 Bytes

1import { createMiddleware } from '@tanstack/react-start'
2​
3import { foo } from '@some/lib'
4​
5export const fnMw = createMiddleware({
6 type: 'function',
7})
8 .server(({ next }) => {
9 console.log('server')
10 foo()
11 return next()
12 })
13 .client(() => {
14 console.log('client')
15 })