本文整理汇总了TypeScript中lodash.partial函数的典型用法代码示例。如果您正苦于以下问题:TypeScript partial函数的具体用法?TypeScript partial怎么用?TypeScript partial使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了partial函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: getById
getById(req: Request, res: Response) {
const userId = parseInt(req.params.id);
User
.getById(userId)
.then(_.partial(Handlers.onSuccess, res))
.catch(_.partial(Handlers.onError, res, 'Erro ao buscar usuรกrio'));
}
开发者ID:mromanjr93,项目名称:nodejsddd,代码行数:7,代码来源:controller.ts
示例2: createUser
createUser(req: Request, res: Response) {
User
.create(req.body)
.then(_.partial(Handlers.onSuccess, res))
.catch(_.partial(Handlers.dbErrorHandler, res))
.catch(_.partial(Handlers.onError, res, `Erro ao inserir novo usuรกrio`));
}
开发者ID:mromanjr93,项目名称:nodejsddd,代码行数:7,代码来源:controller.ts
示例3: updateUser
updateUser(req: Request, res: Response) {
const userId = parseInt(req.params.id);
User
.update(userId, req.body)
.then(_.partial(Handlers.onSuccess, res))
.catch(_.partial(Handlers.onError, res, 'Erro ao atualizar usuรกrio'));
}
开发者ID:mromanjr93,项目名称:nodejsddd,代码行数:7,代码来源:controller.ts
示例4: getTransactionsInternal
function getTransactionsInternal(connection: Connection, address: string,
options: TransactionsOptions
): Promise<GetTransactionsResponse> {
const getter = _.partial(getAccountTx, connection, address, options)
const format = _.partial(formatResponse, connection, options)
return utils.getRecursive(getter, options.limit).then(format)
}
开发者ID:ripple,项目名称:ripple-lib,代码行数:7,代码来源:transactions.ts
示例5: getCourseDetail
export function getCourseDetail(req: Request, res: Response) {
const courseId = parseInt(req.params.id);
findCourseDetail(courseId)
.then(_.partial(onSuccess, res))
.catch(_.partial(onError, res, "Find all courses failed"));
}
开发者ID:vvscode,项目名称:code-notes,代码行数:7,代码来源:courses-id-get.ts
示例6: postLesson
export function postLesson(req: Request, res: Response) {
return createLesson(req.body)
.then(_.partial(onSuccess, res))
.catch(_.partial(onDbError, res, "Error on lesson creation"))
.catch(_.partial(onError, res, "Find all courses failed"));
}
开发者ID:vvscode,项目名称:code-notes,代码行数:7,代码来源:lesson-post.ts
示例7: deleteUser
deleteUser(req: Request, res: Response) {
const userId = parseInt(req.params.id);
User
.delete(userId)
.then(_.partial(Handlers.onSuccess, res))
.catch(_.partial(Handlers.onError, res, 'Erro ao excluir usuรกrio'));
}
开发者ID:mromanjr93,项目名称:nodejsddd,代码行数:8,代码来源:controller.ts
示例8: deleteLesson
export function deleteLesson(req: Request, res: Response) {
const lessonId = req.params.id;
return deleteLessonById(lessonId)
.then(_.partial(onSuccess, res))
.catch(_.partial(onDbError, res, "Error on lesson delete"))
.catch(_.partial(onError, res, "Find all courses failed"));
}
开发者ID:vvscode,项目名称:code-notes,代码行数:8,代码来源:lesson-id-delete.ts
示例9: patchLesson
export function patchLesson(req: Request, res: Response) {
const lessonId = req.params.id;
const props = _.omit(req.body, ["id"]);
return updateLesson(lessonId, props)
.then(_.partial(onSuccess, res))
.catch(_.partial(onDbError, res, "Error on lesson update"))
.catch(_.partial(onError, res, "Find all courses failed"));
}
开发者ID:vvscode,项目名称:code-notes,代码行数:9,代码来源:lesson-id-patch.ts
示例10: formatPartialResponse
function formatPartialResponse(address: string,
options: TransactionsOptions, data
) {
return {
marker: data.marker,
results: data.transactions
.filter(tx => tx.validated)
.map(parseAccountTxTransaction)
.filter(_.partial(transactionFilter, address, options))
.filter(_.partial(orderFilter, options))
}
}
开发者ID:ledgerd,项目名称:ledgerd-lib,代码行数:12,代码来源:transactions.ts
注:本文中的lodash.partial函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论