1.2.1 • Published 6 years ago

v-spot v1.2.1

Weekly downloads
9
License
MIT
Repository
github
Last release
6 years ago

v-spot

Build Status npm Version JS Standard

Spot for v

Installation

$ npm install v-spot --save

Usage

'use strict'

const vSpot = require('v-spot')

async function tryExample () {
  const Spot = vSpot()

  const NewYork = vSpot.clinet()
  const Japan = vSpot.clinet()

  await Spot.listen()
  await NewYork.connect(Spot)
  await Japan.connect(Spot)

  {
    class Person {
      async hi (msg) {
        return `hi, ${msg}`
      }
    }

    // Create a instance to a spot
    const john = NewYork.load(Person, 'jp.realglobe.new-york.john')
    await john.hi('I am in NewYork!')
  }

  {
    // Use remote instance
    const john = await Japan.use('jp.realglobe.new-york.john')
    await john.hi('Calling from Japan!')
  }
}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links

1.2.1

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago