-
Notifications
You must be signed in to change notification settings - Fork 20
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
base: latest
Are you sure you want to change the base?
Conversation
context
object to APOcontext
object to API
6fc5031
to
ac046ae
Compare
Jest fails with this message: expect(received).toBe(expected) // Object.is equality If it should pass with deep equality, replace "toBe" with "toStrictEqual" Expected: {} Received: serializes to the same string This could persuade a developer to switch this to `toStrictEqual`, which would be incorrect.
ac046ae
to
7fe67a2
Compare
@@ -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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
https://ag-grid.atlassian.net/browse/AG-13024