GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Function binding by vplentinax · Pull Request #206 · javascript-tutorial/es.javascript.info Conversation
joaquinelio
requested changes
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @@ -0,0 +1,16 @@ | |||
|
|
|||
|
|
|||
| 1. Utilice una función de contenedor, una flecha para ser conciso: | |||
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| --- | ||
|
|
||
| # Function binding | ||
| # Función vinculadora |
There was a problem 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.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
puede ser "Vinculación de Funciones" ??
Enlazar Funciones ??
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| La tarea es bastante típica --queremos pasar un método de objeto a otro lugar (aquí --al planificador) donde se llamará. ¿Cómo asegurarse de que se llamará en el contexto correcto? | ||
|
|
||
| ## Solution 1: a wrapper | ||
| ## Solución 1: un contenedor o envoltura |
There was a problem 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)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| 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.
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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ``` | ||
|
|
||
| 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.
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, ( )
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| ## 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.
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é
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| Afortunadamente, se puede implementar fácilmente una función `parcial` para vincular solo argumentos. | ||
|
|
||
| Cómo esto: |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Epa, se te coló un acento
Como esto:
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Please make the requested changes. After it, add a comment "/done". |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem 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
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thank you 💖 I updated the Progress Issue #17 🎉 🎉 🎉 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.