Skip to content

Instantly share code, notes, and snippets.

@sygn
Created May 11, 2020 21:46
Show Gist options
  • Select an option

  • Save sygn/2b13d95d845b9e4ec2239a87c90d73e3 to your computer and use it in GitHub Desktop.

Select an option

Save sygn/2b13d95d845b9e4ec2239a87c90d73e3 to your computer and use it in GitHub Desktop.

Revisions

  1. sygn created this gist May 11, 2020.
    16 changes: 16 additions & 0 deletions yup-async.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@

    // email validation
    // .test('checkDuplUsername', 'same name exists', function (value) {
    // return new Promise((resolve, reject) => {
    // kn.http({
    // url: `/v1/api/${value}`,
    // method: 'head',
    // }).then(() => {
    // // exists
    // resolve(false)
    // }).catch(() => {
    // // note exists
    // resolve(true)
    // })
    // })
    // })