Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nfkit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
nfkit
Commits
2a337319
Commit
2a337319
authored
Feb 12, 2026
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support get lazy
parent
87514e32
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
src/app-context/app-context.ts
src/app-context/app-context.ts
+16
-3
No files found.
src/app-context/app-context.ts
View file @
2a337319
...
@@ -189,11 +189,24 @@ export class AppContextCore<Cur = Empty, Req = Empty> {
...
@@ -189,11 +189,24 @@ export class AppContextCore<Cur = Empty, Req = Empty> {
return
this
as
any
;
return
this
as
any
;
}
}
get
<
R
>
(
cls
:
AppServiceClass
<
Cur
,
Req
,
any
,
R
>
):
R
{
get
<
R
>
(
const
key
=
cls
as
unknown
as
AnyClass
;
cls
:
|
AppServiceClass
<
Cur
,
Req
,
any
,
R
>
|
(()
=>
AppServiceClass
<
Cur
,
Req
,
any
,
R
>
),
):
R
{
let
key
=
cls
as
unknown
as
AnyClass
;
if
(
!
this
.
registry
.
has
(
key
)
&&
typeof
cls
===
'
function
'
&&
!
(
cls
as
any
).
prototype
)
{
key
=
(
cls
as
()
=>
AppServiceClass
<
Cur
,
Req
,
any
,
R
>
)()
as
AnyClass
;
}
if
(
!
this
.
registry
.
has
(
key
))
{
if
(
!
this
.
registry
.
has
(
key
))
{
throw
new
Error
(
`Service not provided:
${
cls
.
name
}
`
);
throw
new
Error
(
`Service not provided:
${
key
?.
name
??
cls
.
name
}
`);
}
}
const entry = this.registry.get(key)!;
const entry = this.registry.get(key)!;
const inst = entry.inst;
const inst = entry.inst;
if (isPromiseLike(inst)) {
if (isPromiseLike(inst)) {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment