Skip to content

SmartAddress: Dynamic Address Autocomplete Suggestions in TypeScript

Notifications You must be signed in to change notification settings

Divensky/smart-address

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

smart-address

SmartAddress: Dynamic Autocomplete with DaData API in TypeScript

Project Overview

An address autocomplete functionality using an API that provides address suggestions.

Technical Details

This is a set of TypeScript functions to display address suggestions based on the data from DaData API.

Key Features

An input field listens for address input. When the user types a letter, the function makes an API call and displays the address suggestions once fetched. The user may accept any suggestion and/or continue typing and see more suggestions.

The input is debounced. If the second API request comes while the first one is not complete, the first one gets aborted. The API takes care of the maximum length of suggestions list and filters the most relevant suggestions.

The suggestions container is re-used to minimize DOM changes.

This is how it looks like:

borisoglebskoe screen shot

Usage

The API token is not included in this code, and neither is the function that calls the API. To obtain and use one's own API token, visit the DaData website. This website also gives instructions and code to make an API call. In case of any questions, please contact the repo owner.

You are welcome to learn from this code, but it cannot be used for commercial purposes without permission.

About

SmartAddress: Dynamic Address Autocomplete Suggestions in TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published