Skip to content

Commit

Permalink
chore: remove unused property from translation API (#851)
Browse files Browse the repository at this point in the history
`TranslationApi` was storing a property called `#table` which was never
used. This removes it.
  • Loading branch information
EvanHahn authored Sep 19, 2024
1 parent 90e91ef commit b2c2a91
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/mapeo-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ export class MapeoProject extends TypedEmitter {

this.#translationApi = new TranslationApi({
dataType: this.#dataTypes.translation,
table: translationTable,
})

///////// 4. Replicate local peers automatically
Expand Down
5 changes: 1 addition & 4 deletions src/translation-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export default class TranslationApi {
* Set<import('@comapeo/schema/dist/types.js').SchemaName>>} */
#translatedLanguageCodeToSchemaNames = new Map()
#dataType
#table
#indexPromise

/**
Expand All @@ -26,11 +25,9 @@ export default class TranslationApi {
* Translation,
* TranslationValue
* >} opts.dataType
* @param {typeof import('./schema/project.js').translationTable} opts.table
*/
constructor({ dataType, table }) {
constructor({ dataType }) {
this.#dataType = dataType
this.#table = table
this.#indexPromise = this.#dataType
.getMany()
.then((docs) => {
Expand Down
5 changes: 1 addition & 4 deletions tests/data-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,7 @@ async function testenv(opts = {}) {
},
})

const translationApi = new TranslationApi({
dataType: translationDataType,
table: translationTable,
})
const translationApi = new TranslationApi({ dataType: translationDataType })

const dataType = new DataType({
dataStore,
Expand Down
5 changes: 1 addition & 4 deletions tests/translation-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,5 @@ function setup() {
},
})

return new TranslationApi({
dataType,
table,
})
return new TranslationApi({ dataType })
}

0 comments on commit b2c2a91

Please sign in to comment.