You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has become expecially important because of how mixins work (don't work?) with TypeScript 2.6 (see: microsoft/TypeScript#9944).
So, for example to get an @Model working, there's an export tap dance that needs to happen:
import {
Db,
IDbGetParams,
IFromDbOptions,
Json,
Model,
SakuraApi,
SapiModelMixin
} from '@sakuraapi/api';
import {
Collection,
CollectionInsertOneOptions,
CollectionOptions,
Cursor,
Db as MongoDb,
DeleteWriteOpResultObject,
InsertOneWriteOpResult,
ObjectID,
ReplaceOneOptions,
UpdateWriteOpResult
} from 'mongodb';
import {dbs} from '../config/db';
export {
Collection,
CollectionInsertOneOptions,
CollectionOptions,
Cursor,
MongoDb,
DeleteWriteOpResultObject,
InsertOneWriteOpResult,
ObjectID,
ReplaceOneOptions,
UpdateWriteOpResult,
IDbGetParams,
IFromDbOptions,
SakuraApi
};
@Model({
dbConfig: dbs.user
})
export class User extends SapiModelMixin() {
}
That's a lot of setup work. It looks like TypeScript issue 9944 is scheduled to have some sort of solution in 2.8, so revisit the issue then. In the meantime, sapi cli needs to reduce the pain in setting up a model.
Might as well create generators for Services and Routables at the same time.
The text was updated successfully, but these errors were encountered:
This has become expecially important because of how mixins work (don't work?) with TypeScript 2.6 (see: microsoft/TypeScript#9944).
So, for example to get an
@Model
working, there's an export tap dance that needs to happen:That's a lot of setup work. It looks like TypeScript issue 9944 is scheduled to have some sort of solution in 2.8, so revisit the issue then. In the meantime,
sapi
cli needs to reduce the pain in setting up a model.Might as well create generators for Services and Routables at the same time.
The text was updated successfully, but these errors were encountered: