dgtek-test-address

1.0.7 • Public • Published

dgtek-test-address

How to install

npm install dgtek-test-address --save

How to use

First of all require package

const TestAddress = require('dgtek-test-address')

or

import TestAddress from 'dgtek-test-address'

Then create input element or use existing one (DOM element)

const inputAddress = document.getElementById('input-address')

This element (inputAddress in this example) will receive events

Events

You should catch events of input element:

inputAddress.addEventListener('available', catchEvent)
inputAddress.addEventListener('build', catchEvent)
inputAddress.addEventListener('notAvailable', catchEvent)

Callback function (catchEvent in this example) will receive event object

This object contain two properties:

address

string

type

string ('available', 'build', 'notAvailable')

Callback function

function catchEvent (event) {
  console.log(event.type)
  console.log(event.address)
}

Now you are ready to start

const testAddress = new TestAddress({ input: inputAddress })

Package Sidebar

Install

npm i dgtek-test-address

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

5.45 kB

Total Files

4

Last publish

Collaborators

  • garevna