Commit 274fe40 Ryan Burns
committed
1 parent c0d900e commit 274fe40 Copy full SHA for 274fe40
File tree 3 files changed +12
-2
lines changed
3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ ## [ 1.0.0-alpha.2] - 2020-03-11
4
+ - Add number type support for query property
5
+ - dispatch data-changed event
6
+
7
+ ## [ 1.0.0-alpha.1] - 2020-03-10
8
+ - Initial commit
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " lit-weather" ,
3
- "version" : " 0.0.1 " ,
3
+ "version" : " 1. 0.0-alpha.2 " ,
4
4
"description" : " lit-weather is a web component using lit-html to display current weather and a forecast with the openWeather apis" ,
5
5
"author" : " lit-weather" ,
6
6
"license" : " MIT" ,
Original file line number Diff line number Diff line change @@ -379,7 +379,8 @@ export class LitWeather extends LitElement {
379
379
// eslint-disable-next-line class-methods-use-this
380
380
_getLocationParam ( query ) {
381
381
// eslint-disable-next-line no-restricted-globals
382
- const isZipCode = ! isNaN ( query . charAt ( 0 ) - parseFloat ( query . charAt ( 0 ) ) ) ;
382
+ const firstChar = query . toString ( ) . charAt ( 0 ) ;
383
+ const isZipCode = ! isNaN ( firstChar - parseFloat ( firstChar ) ) ;
383
384
return isZipCode ? `zip=${ query } ` : `q=${ query } ` ;
384
385
}
385
386
@@ -408,6 +409,7 @@ export class LitWeather extends LitElement {
408
409
} ) ,
409
410
fullForecastUrl : `https://openweathermap.org/city/${ data . id } ` ,
410
411
} ;
412
+ this . dispatchEvent ( new CustomEvent ( 'data-changed' , { detail : { value : this . data } } ) ) ;
411
413
} )
412
414
. catch ( error => {
413
415
this . _handleWeatherError ( error ) ;
You can’t perform that action at this time.
0 commit comments