Skip to content

Commit

Permalink
[lens-person] Remove get and set methods (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
themetar authored Nov 6, 2024
1 parent 25a0a8d commit 94f7341
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
3 changes: 3 additions & 0 deletions exercises/practice/lens-person/.meta/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"sarava338",
"Cool-Katt"
],
"contributors": [
"themetar"
],
"files": {
"solution": [
"lens-person.js"
Expand Down
23 changes: 2 additions & 21 deletions exercises/practice/lens-person/lens.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
export class Lens {
/**
*
* @param {Function} getter
* @param {Function} setter
* @param {Function} getter - Function to get the value using a lens
* @param {Function} setter - Function to set the value using a lens
*/
constructor(getter, setter) {
this.get = getter;
this.set = setter;
}

/**
* Function to get the value from a lens
* @param {Person} person
* @returns {Person}
*/
get(person) {
return this.get(person);
}

/**
* Function to set the value using a lens
* @param {Person} person
* @param {any} value
* @returns {Person}
*/
set(person, value) {
return this.set(value, person);
}
}

0 comments on commit 94f7341

Please sign in to comment.