Socket
Socket
Sign inDemoInstall

mina-kit

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    mina-kit

实用小程序工具合集


Version published
Weekly downloads
4
Maintainers
1
Install size
53.9 kB
Created
Weekly downloads
 

Readme

Source

mina-kit

实用小程序工具合集

登录工具

介绍文章

// 引入
import { reuse } from 'mina-kit'
// or
const { reuse } = require('mina-kit')

// 使用
const requestLogin = reuse(() =>  {
    return new Promise(resolve => {
        console.log('===处理登录请求===');
        setTimeout(() => {
            console.log('===登录请求响应===');
            resolve({
                token: 'mock'
            });
        }, 1000);
    });
});

requestLogin().then(e => console.log('连续发起请求: A', e));
requestLogin().then(e => console.log('连续发起请求: B', e));

setTimeout(() => {
    requestLogin().then(e => console.log('未完成初始化请求时发起请求', e));
}, 500);

setTimeout(() => {
    requestLogin().then(e => console.log('后续发起请求A', e));
}, 2000);

License

MIT.

FAQs

Last updated on 03 Apr 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc