Skip to content

Commit 75fe2c3

Browse files
committed
PR Feedback: Rename ApiItem_setParent to ApiItem_onParentChanged to clarify that it is not intended to be a general purpose property setter
1 parent 32fb006 commit 75fe2c3

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

apps/api-extractor-model/src/items/ApiItem.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export interface IApiItemJson {
5252
// PRIVATE - Allows ApiItemContainerMixin to assign the parent.
5353
//
5454
// tslint:disable-next-line:variable-name
55-
export const ApiItem_setParent: unique symbol = Symbol('ApiItem._setParent');
55+
export const ApiItem_onParentChanged: unique symbol = Symbol('ApiItem._onAddToContainer');
5656

5757
/**
5858
* The abstract base class for all members of an `ApiModel` object.
@@ -245,11 +245,11 @@ export class ApiItem {
245245
* PRIVATE
246246
*
247247
* @privateRemarks
248-
* Allows ApiItemContainerMixin to assign the parent.
248+
* Allows ApiItemContainerMixin to assign the parent when the item is added to a container.
249249
*
250250
* @internal
251251
*/
252-
public [ApiItem_setParent](parent: ApiItem | undefined): void {
252+
public [ApiItem_onParentChanged](parent: ApiItem | undefined): void {
253253
this._parent = parent;
254254
this._canonicalReference = undefined;
255255
}

apps/api-extractor-model/src/mixins/ApiItemContainerMixin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
22
// See LICENSE in the project root for license information.s
33

4-
import { ApiItem, ApiItem_setParent, IApiItemJson, IApiItemOptions, IApiItemConstructor } from '../items/ApiItem';
4+
import { ApiItem, ApiItem_onParentChanged, IApiItemJson, IApiItemOptions, IApiItemConstructor } from '../items/ApiItem';
55
import { ApiNameMixin } from './ApiNameMixin';
66
import { DeserializerContext } from '../model/DeserializerContext';
77

@@ -145,7 +145,7 @@ export function ApiItemContainerMixin<TBaseClass extends IApiItemConstructor>(ba
145145
this[_membersSorted] = false;
146146
this[_membersByContainerKey].set(member.containerKey, member);
147147

148-
member[ApiItem_setParent](this);
148+
member[ApiItem_onParentChanged](this);
149149
}
150150

151151
public tryGetMemberByKey(containerKey: string): ApiItem | undefined {

common/reviews/api/api-extractor-model.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export class ApiInterface extends ApiInterface_base {
233233
// @public
234234
export class ApiItem {
235235
// @internal
236-
[ApiItem_setParent](parent: ApiItem | undefined): void;
236+
[ApiItem_onParentChanged](parent: ApiItem | undefined): void;
237237
constructor(options: IApiItemOptions);
238238
// @virtual
239239
protected buildCanonicalReference(): DeclarationReference;

0 commit comments

Comments
 (0)