當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript lodash.partial函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。