Skip to content

Commit 9071b90

Browse files
author
Steven Orvell
committed
Renamed decorator to queryAsync based on review feedback.
1 parent b396c93 commit 9071b90

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
2222
* The value returned by `render` is always rendered, even if it isn't a `TemplateResult`. ([#712](https://github.com/Polymer/lit-element/issues/712)
2323

2424
### Added
25-
* Added `@asyncQuery(selector)` decorator which returns a Promise resolves to the result of querying for the given selector after the element's `updateComplete` Promise resolves ([#903](https://github.com/Polymer/lit-element/issues/903)).
25+
* Added `@queryAsync(selector)` decorator which returns a Promise that resolves to the result of querying for the given selector after the element's `updateComplete` Promise resolves ([#903](https://github.com/Polymer/lit-element/issues/903)).
2626
* Added `enableUpdating()` to `UpdatingElement` to enable customizing when updating is enabled [#860](https://github.com/Polymer/lit-element/pull/860).
2727
* Added `queryAssignedNodes(slotName, flatten)` to enable querying assignedNodes for a given slot [#860](https://github.com/Polymer/lit-element/pull/860).
2828
* Added `getStyles()` to `LitElement` to allow hooks into style gathering for component sets [#866](https://github.com/Polymer/lit-element/pull/866).

src/lib/decorators.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export function query(selector: string) {
250250
* @example
251251
*
252252
* class MyElement {
253-
* @asyncQuery('#first')
253+
* @queryAsync('#first')
254254
* first;
255255
*
256256
* render() {
@@ -261,7 +261,7 @@ export function query(selector: string) {
261261
* }
262262
* }
263263
*/
264-
export function asyncQuery(selector: string) {
264+
export function queryAsync(selector: string) {
265265
return (protoOrDescriptor: Object|ClassElement,
266266
// tslint:disable-next-line:no-any decorator
267267
name?: PropertyKey): any => {

src/test/lib/decorators_test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414

1515
import {eventOptions, property} from '../../lib/decorators.js';
16-
import {customElement, html, LitElement, PropertyValues, query, queryAll, queryAssignedNodes, asyncQuery} from '../../lit-element.js';
16+
import {customElement, html, LitElement, PropertyValues, query, queryAll, queryAssignedNodes, queryAsync} from '../../lit-element.js';
1717
import {generateElementName} from '../test-helpers.js';
1818

1919
const flush =
@@ -460,13 +460,13 @@ suite('decorators', () => {
460460
});
461461
});
462462

463-
suite('@asyncQuery', () => {
463+
suite('@queryAsync', () => {
464464

465465
@customElement(generateElementName() as keyof HTMLElementTagNameMap)
466466
class C extends LitElement {
467-
@asyncQuery('#blah') blah!: Promise<HTMLDivElement>;
467+
@queryAsync('#blah') blah!: Promise<HTMLDivElement>;
468468

469-
@asyncQuery('span') nope!: Promise<HTMLSpanElement|null>;
469+
@queryAsync('span') nope!: Promise<HTMLSpanElement|null>;
470470

471471
@property()
472472
foo = false;

0 commit comments

Comments
 (0)