Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AG-13024 Add context object to API #3679

Open
wants to merge 25 commits into
base: latest
Choose a base branch
from

Conversation

olegat
Copy link
Contributor

@olegat olegat commented Feb 26, 2025

@olegat olegat changed the title AG-13024 Add context object to APO AG-13024 Add context object to API Feb 26, 2025
@olegat olegat force-pushed the AG-13024/add_context_object_to_api branch 2 times, most recently from 6fc5031 to ac046ae Compare February 27, 2025 16:48
@olegat olegat force-pushed the AG-13024/add_context_object_to_api branch from ac046ae to 7fe67a2 Compare February 28, 2025 11:40
@olegat olegat marked this pull request as ready for review February 28, 2025 12:46
@olegat olegat requested a review from iMoses as a code owner February 28, 2025 12:46
@olegat olegat requested a review from alantreadway as a code owner February 28, 2025 12:46
@@ -3,6 +3,9 @@ import { Logger, isArray } from 'ag-charts-core';
import { extractDecoratedPropertyMetadata, listDecoratedProperties } from './decorator';

export class BaseProperties<T extends object = object> {
// user pass-through option: no validation-decorator required.
context?: unknown;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the right class for this, as it's used as the base class for a lot of use-cases where this isn't relevant - perhaps we could have a ContextProperties extends BaseProperties base class with the context-related behaviours, which is extended in the specific cases where this behaviour is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's used as the base class for a lot of use-cases where this isn't relevant

Why does this matter?

Removing this property will raise this compiler error:

packages/ag-charts-community/src/util/properties.ts:41:18 - error TS2339: Property 'context' does not exist on type 'BaseProperties<T>'.
  39 |         }
  40 |         if ('context' in properties) {
> 41 |             this.context = properties.context;
     |                  ^
  42 |             keys.delete('context');
  43 |         }
  44 |         for (const unknownKey of keys) {

This if is necessary to avoid warnings

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants