-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from korsun/mapService
Merge pull request #4
- Loading branch information
Showing
11 changed files
with
259 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createNanoEvents } from 'nanoevents'; | ||
|
||
export class EventEmitter { | ||
private emitter: ReturnType<typeof createNanoEvents>; | ||
|
||
constructor() { | ||
this.emitter = createNanoEvents(); | ||
} | ||
|
||
public emit = (name: string, data?: unknown, duration?: number) => { | ||
this.emitter.emit(name, data, duration); | ||
}; | ||
|
||
public onEvent = (eventName: string, fn: AnyFunction) => | ||
this.emitter.on(eventName, fn); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
export const MAX_POINTS_WITH_FREE_API = 5; | ||
export const ROUTE_LINE_STYLES = { | ||
'fill-color': 'rgba(255, 255, 255, 0.2)', | ||
'stroke-color': 'red', | ||
'stroke-width': 5, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './api'; | ||
export * from './map'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { MapService } from './mapService'; |
Oops, something went wrong.