Hexagonal architecture #88613
newtonEMC2
started this conversation in
Ideas
Replies: 0 comments
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.
Goals
Apply different layers of abstraction in the code
Non-Goals
Background
I want to use several layers of abstraction. From a .tsx, i want to call a use case, that at the same time calls a repository for an http call.
Seems like "use cache" must wrap the function that performs fetch() — not a function that returns another function that later fetches
I get this error:
Failed to fetch templates: {
status: 'error',
message: 'During prerendering, fetch() rejects when the prerender is complete. Typically these errors are handled by React but if you move fetch() to a different context by using
setTimeout,after, or similar functions you may observe this error and you should handle it in that context. This occurred at route "/".',code: 'NETWORK_ERROR',
details: {
originalError: Error: During prerendering, fetch() rejects when the prerender is complete. Typically these errors are handled by React but if you move fetch() to a different context by using
setTimeout,after, or similar functions you may observe this error and you should handle it in that context. This occurred at route "/".at new Promise ()
at b.request (src/lib/http/infrastructure/fetch-http-client.adapter.ts:32:30)
at b.get (src/lib/http/infrastructure/fetch-http-client.adapter.ts:87:17)
at Object.getAllTemplates (src/lib/http/infrastructure/repositories/template.repository.ts:49:34)
at j (src/lib/http/application/template.actions.ts:56:47)
at aF (src/app/(root)/featured-templates.tsx:60:24)
30 |
31 | try {
> 32 | const response = await fetch(fullUrl, fetchConfig);
| ^
33 | const parsedData = await this.parseResponse(response);
34 |
35 | // Type guard for error response structure {
route: '/',
expression: 'fetch()',
digest: 'HANGING_PROMISE_REJECTION'
}
}
}
Proposal
Need to handle the dangling async functions
All reactions