本文整理匯總了TypeScript中@tsed/core.Store.set方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Store.set方法的具體用法?TypeScript Store.set怎麽用?TypeScript Store.set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@tsed/core.Store
的用法示例。
在下文中一共展示了Store.set方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: UseAfter
return Store.decorate((store: Store, parameters: DecoratorParameters) => {
store.set("statusCode", code);
const response = mapReturnedResponse(options);
store.merge("response", response);
store.merge("responses", {[code]: response});
return UseAfter((request: any, response: any, next: any) => {
if (response.statusCode === 200) {
response.status(code);
}
next();
});
});
示例2: UseBefore
return Store.decorate((store: Store) => {
store.set(guardAuth, options);
if (options.responses) {
const {responses} = options;
store.merge("responses", responses);
}
if (options.security) {
const {security} = options;
store.merge("operation", {security});
}
return UseBefore(guardAuth);
})(...args);
示例3: UseAfter
return Store.decorate((store: Store) => {
store.set(ResponseViewMiddleware, {viewPath, viewOptions});
return UseAfter(ResponseViewMiddleware);
});
示例4: UseBefore
return Store.decorate((store: Store, parameters: DecoratorParameters) => {
store.set(AcceptMimesMiddleware, mimes);
return UseBefore(AcceptMimesMiddleware);
});