$self->ua vs. Mojo::UserAgent->new #2059
Answered
by
kraih
hussam-qasem
asked this question in
Q&A
-
I'm stating to fall in love with everything Mojolicious. I am converting an old application which uses: and I find My other question is related to the re-use of
|
Beta Was this translation helpful? Give feedback.
Answered by
kraih
Apr 17, 2023
Replies: 1 comment 6 replies
-
I would probably consider that a model, and store an instance of the class in a helper during startup: $self->helper(cool => sub { state $cool = MyApp::Network::Cool->new($app->ua) }); |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
hussam-qasem
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would probably consider that a model, and store an instance of the class in a helper during startup: