package.jsons are changed because dependencies are now sorted
tsconfig.jsons are changed because all referenced monorepo packages will
be added as project references
tsconfig.esm.jsons are changed because syncEsmConfig was run
It has different type definitions for some methods used in express and
TypeScript build fails because of it.
The solution is to use @types/express-serve-static-core instead.
The old code was returning a fn because TypeScript could not figure out
generic type parameters when params was an object like:
interface Params<State> {
a: Reducer<State>
b: Partial<State>
}
function test<State>(params: Params<State>) {
// ...
}
The pending action will be modified and a newly created promise handler
will be returned.
This has (suddenly?) caused errors in tests because the catch() handlers defined in tests would be called before the one defined in PromiseMiddleware:
const p = new Promise(...)
const {payload} = store.dispatch({
payload: new Promise(...),
type: '...',
})
try {
await payload
} catch (err) {
// this handler would be invoked before the catch handler in
// PromiseMiddleware
}
since the PromiseMiddleware adds a then-callback, followed by a
catch-callback.
As seen in TeamService2.ts, the Contextual type will add Context as the
last argument to any method of the interface, as long as the method has
0-4 arguments.
Interfaces with more than 4 arguments cannot use this type, but they
could be converted to interfaces which use 1 argument
(object/dictionary) only.
Some long-term thinking: Maybe only methods with a single argument
should be supported, similar to the way gRPC does it.
In this case the interface does not define context, but the implementing
service may use it as an optional argument:
interface IService {
add(a: number, b: number): number
}
class Service implements IService {
add(a: number, b: number, ctx?: IContext): number {
return a + b + ctx!.userId
}
}