Socket
Book a DemoInstallSign in
Socket

meidos

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

meidos

Your lovely and versatile Meidos

latest
npmnpm
Version
0.1.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

Meidos

Your lovely and versatile Meidos

preload

install

$ yarn add meidos

Usage

import { Queue } from 'meidos'

const Task = new Queue()
  let count = 0

  Task
    .set({concurrency: 1})
    .run(async (ctx, next) => {
      expect(++count).toBe(1)
      await next()
      expect(++count).toBe(4)
    })
    .run((ctx, next) => {
      expect(++count).toBe(2)
      next()
    })
    .run( async (ctx, next) => {
      await next()
      expect(++count).toBe(5)
    })
    .run((ctx, next) => {
      expect(++count).toBe(3)
    })
import { Message } from 'meidos'

const message = new Message()
  let count = 1

  message
    .on('set', (value) => {
      count = value
    })
    .emit('set', 1000)
      expect(count).toBe(1000)
    })

import  { Observer } from 'meidos'

const observer = new Observer()

  observer
    .subscribe(val => {
      expect(++val).toBe(2) 
    })
    .subscribe(val => {
      expect(--val).toBe(0)
    })
    .publish(1)

FAQs

Package last updated on 20 Feb 2017

Did you know?

Socket

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