What are the advantages of using State vs Extensions? #1830
thomasmost
started this conversation in
General
Replies: 3 comments 13 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Can you apply more than one state object to one router?
…On Wed, Mar 8, 2023, 1:47 PM David Pedersen ***@***.***> wrote:
State is type safe, Extension is not. If you forget
.layer(Extension(pool)); everything will still compile but fail at
runtime. Not so with State.
—
Reply to this email directly, view it on GitHub
<#1830 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB44JJYWNCZ4QEYXVJTWFU3W3DH53ANCNFSM6AAAAAAVUDJRFA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
-
Is it possible to use both? 😂 |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Specifically, a route handler for me currently looks something like this:
vs
...but what are the advantages of using State for db pool management/why should I? I understand that state is shared between all routes but I think that's still true with this initialization, yes?
Beta Was this translation helpful? Give feedback.
All reactions