T
TanStack2mo ago
optimistic-gold

Exposure of codes to the client

Hello! I hope I understand correctly. So that: - createServerFn() and createServerOnlyFn() both runs on the server - createServerFn() can be called from the client but not createServerOnlyFn() - the source code within both createServerFn() and createServerOnlyFn() are not exposed to the client Could you please confirm? Thanks
2 Replies
harsh-harlequin
harsh-harlequin2mo ago
yes createServerOnlyFn makes a function that is undefined in the client bundle createServerFn creates a function that is...well just the function, in the server bundle, and an api call on the client bundle
optimistic-gold
optimistic-goldOP2mo ago
thank you @notKamui ^_^

Did you find this page helpful?