Comments (6)
agreed, so i added the following type in packages/core/src/include.d/koa.d.ts
:
export type KoaMiddleware<T, R> = (context: T, next: KoaNext<R>) => Promise<void>;
this makes sure that middleware is a void
promise which means nothing. plus, return can enable eslint check for unreachable code and save 1 LOC for every middleware that doesn't need operations after next
.
also check out the official example of using return next()
.
from logto.
Koa's middleware uses ctx
instead of return value, is not "pure function", so return value may not be important.
from logto.
yes, just wanna align our code style.
from logto.
agreed with you that return value doesn't matter.
from logto.
disallow return has an adventage: prevent treating the return value as useful staff by mistake
from logto.
from logto.
Related Issues (20)
- bug: Your Vanilla JS Instructions Do Not Work HOT 8
- feature request: Rails SDK
- feature request: how to send the custom-data of user with id_token and access_token HOT 8
- feature request: expose error_detail from oidc-provider HOT 6
- bug: Translation in Sign-in Experience is incorrect HOT 4
- bug: Component is using default input validation HOT 4
- feature request: Ability to notify users of permission changes HOT 7
- bug: Error: Must install Logto plugin first HOT 5
- feature request: Claims for fine grained authentication HOT 5
- bug: Not working with Expo HOT 8
- bug: The development environment is not suitable for Windows HOT 3
- feature request: Attribute Based Access Control HOT 1
- feature request: if I can restrict the app to an organization? HOT 6
- feature request: Elixir SDK HOT 1
- bug: no applicable key found in the JSON Web Key Set HOT 8
- feature request: api to create first management m2m application HOT 4
- feature request: anonymous users HOT 5
- feature request: NextJs 13 app folder API route support HOT 1
- feature request: MFA email otp HOT 5
- feature request: Better M2M Serect transmission HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from logto.