adopted-ember-addons / adopted-ember-addons/validated-changeset

Change all apis on the Change, Data, all internal structures to be Symbols in order to not conflict with passed in data

Abierto
#122 8 comentarios 1 reacción 0 asignados Ver en GitHub
enhancement
Lenguaje dominante
TypeScript
Estrellas
38
Forks
27
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

Reproduction: https://runkit.com/nullvoxpopuli/reproduction-for-validated-changeset-122

for example,

```js
import { Changeset as createChangeset } from 'validated-changeset';

let data = {
trigger: { ...}
};

let changeset = createChangeset(data)
```
the data, `trigger` conflicts with: https://github.com/validated-changeset/validated-changeset/blob/ca0c7d249fc2244edaeb7aef25bdf06583628efa/src/index.ts#L144

I propose all internal APIS be assigned to private symbols instead of regular keys to not conflict with passed data:

example:
```js
const TRIGGER = Symbol('__private__trigger__');

// ...
[TRIGGER](eventName: string, ...args: any[]): void {
const notifier = notifierForEvent(this, eventName);

if (notifier) {
notifier.trigger(...args);
}
```

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.