Neighbour Problem Manager

    medios

    0.0.1 • Public • Published

    Meidos

    Your lovely and versatile maids

    install

    $ yarn add medios
    

    Usage

    import {Task} from 'medios'
     
    const Task = new Queue(2)
    let count = 0
     
    Task.push(async next => {
      expect(++count).toBe(1)
      await next()
      expect(++count).toBe(4)
    })
     
    Task.push(next => {
      expect(++count).toBe(2)
      next()
    })
     
    Task.push( async next => {
      await next()
      expect(++count).toBe(5)
    })
     
    Task.push( next => {
      expect(++count).toBe(3)
    })
    import {Message} from 'medios'
     
    const message = new Message()
    let count = 1
     
    message.on('set', (value) => {
      count = value
    })
    message.emit('set', 1000)
    expect(count).toBe(1000)
     
    import  {Observer} from 'medios'
     
    const observer = new Observer()
     
    observer.subscribe(val => {
      expect(++val).toBe(2) 
    })
     
    observer.subscribe(val => {
      expect(--val).toBe(0)
    })
     
    observer.publish(1)

    Keywords

    none

    Install

    npm i medios

    DownloadsWeekly Downloads

    0

    Version

    0.0.1

    License

    MIT

    Last publish

    Collaborators

    • vaiii
    • koishi