-
Notifications
You must be signed in to change notification settings - Fork 226
Function binding #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Function binding #206
Conversation
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.
Muy fluido y las palabras adecuadas, es bueno.
Para discusión. De varios comentarios que puse, cambié de opinión en el caso de conjugaciones, dejarlas en inglés sería delirante. Pero me mantengo en las definiciones js: bind, wrapper, en dejarlas en inglés o aclarar inmediatamente entre paréntesis. Que el lenguaje no distraiga. Por ej.: ver "contenedor" o "vincular" pasa desapercibido cuando en realidad se está refiriendo a algo muy específico.
1-js/06-advanced-functions/10-bind/5-question-use-bind/solution.md
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,16 @@ | |||
|
|||
|
|||
1. Utilice una función de contenedor, una flecha para ser conciso: |
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.
Para glosario y discusión. Solo opino, me pliego a lo que decidan:
El original está feo. Y en español el sentido encima se desdibuja. Prefiérolo más específico:
"Use una función wrapper, de tipo arrow para ser conciso..."
Me pongo en lugar del que está aprendiendo, si usamos español es más difícil hacer la conexión a que es un tema ya estudiado, y el concepto es importante
wrapper, una función nueva que envuelve a otra existente para darle más... funcionalidad
arrow la forma abreviada: ( ) =>
no traducirlos hiere mi sentido del castellano PERO impactante más al que está aprendiendo
pues no tiene que aprender el doble, la def en inglés y en castellano, la literatura está llena de wrapper objects y tiene que fijarla.
En otro lado usé "envoltura" solamente para definirlo, contenedor creo que también está bien, pero si lo traducimos como definición (uf) deberíamos usar siempre lo mismo.
@@ -3,17 +3,17 @@ libs: | |||
|
|||
--- | |||
|
|||
# Function binding | |||
# Función vinculadora |
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.
sugiero siempre aclarar, para que se fije el tema.
Si buscara el tema, querría que bind (el nombre de la funcipn) o binding estuvieran en el título.
"Función bind (vincular)" o "Función vinculadora (bind)"
Glosario, discusión:
BINDING es otro concepto importante, no lo traduciría, pero es algo personal.
MDN aparece a veces como enlace y otras como vínculo, tanto sinónimo hace más arduo asimilarlo.
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.
puede ser "Vinculación de Funciones" ??
Enlazar Funciones ??
|
||
## Solution 1: a wrapper | ||
## Solución 1: un contenedor o envoltura |
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.
prefiero aclarar
un contenedor o envoltura (wrapper)
o
un wrapper (envoltura)
|
||
The result of `func.bind(context)` is a special function-like "exotic object", that is callable as function and transparently passes the call to `func` setting `this=context`. | ||
El resultado de `func.bind(context)` es una función especial "objeto exótico" similar a una función regular, que se puede llamar como función y pasa la llamada de forma transparente a `func` estableciendo `this = context`. |
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.
fluidez
es un "objeto exótico", una función especial similar a una función regular que
``` | ||
|
||
In the line `(*)` we take the method `user.sayHi` and bind it to `user`. The `sayHi` is a "bound" function, that can be called alone or passed to `setTimeout` -- doesn't matter, the context will be right. | ||
En la línea `(*)` tomamos el método `user.sayHi` y lo vinculamos a `user`. `sayHi` es una función "enlazada", que se puede llamar sola o pasarse en `setTimeout` -- no importa, el contexto será el correcto. |
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.
( ) sayHi
es una función "enlazada", que pueda llamarse sola o pasarse en setTimeout
-- no importa, ( )
|
||
## Parcial sin contexto | ||
|
||
¿Qué pasa si nos gustaría arreglar algunos argumentos, pero no el contexto `this`? Por ejemplo, para un método de objeto. |
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.
incómodo
Y si quisiéramos arreglar algunos ( ) ?
arreglar ¿o fijar? Bien lo usaste así en otros lados. bind "fija" this ligando, pero también "arregla" la pérdida de this
no sé
|
||
Afortunadamente, se puede implementar fácilmente una función `parcial` para vincular solo argumentos. | ||
|
||
Cómo esto: |
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.
Epa, se te coló un acento
Como esto:
Please make the requested changes. After it, add a comment "/done". |
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.
Bind =est�� a vecs enlace, a veces vínculo.
subjuntivo en algun lado
Pero como antes, es mínimo y no me importa, hacé de cuenta que no te dije nada.
Approve
Thank you 💖 I updated the Progress Issue #17 🎉 🎉 🎉 |
No description provided.