-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi,

I like the idea of reducing the global scope, but the context
overloading as well as introducing additional arguments does not feel
right to me.
Why not using CommonJS for that?

function(doc) {
  var emit = require('emit')
  emit(doc.date, null)
}

Best
Schmidt

On 02.12.2015 13:42, Alexander Shorin wrote:
> Hi Garren,
> 
> On Wed, Dec 2, 2015 at 3:35 PM, Garren Smith <gar...@apache.org>
> wrote:
>> 
>> This is an interesting idea. I think passing the emit function in
>> is a good idea and might make somethings easier in PouchDB. I
>> would rather a  map function looked something like this
>> 
>> function (doc, emit) {
>> 
>> }
> 
> That's nice, but won't work: map function has access to a lot of
> other global functions we provide, so you'll end with signature of
> 7 arguments.  I don't think there is any reason to fix this problem
> by a half. Just fix all globals or no one.
> 
>> I don’t like the idea of passing a userCtx object. That feels
>> overly bulky. Things like JSON/require are global variables in
>> Node.js or the browser so my feeling is to follow their lead on
>> those.
> 
> ctx referenced not to userCtx, but a generic context object that
> hold all the global function and objects we provide now. These are
> listed in reference on documentation. May be we can find a better
> name to not cause confusion. funcs? env? Suggestions welcome (:
> 
> -- ,,,^..^,,,
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWXuomAAoJED+W7gN+c0gcVaUH/3YtkAG+ravPmp5v0L0JET7Q
MxtDoqBFOotZMKExckVF8PMCbg+WZ2a5hb/V2BgVUeuPkp89a0nPdAwfPohOX6be
9OSMkpaND7BCkPUaoduY2wHrNdYggI+nwxsjqm9E/LT+N05C/b69MoekOQtV3e9P
ozdIOXrXn7U84hAsbUYxgwmtP3Ug/g5+TJJtpn0tNy10+xS/ddufovezrL/+m5ml
PZT8EZDGHufKcslNlmN6wxLHXiqgQkwnebrC6TKTH+vP6vjLxFyK/212RplCtFGp
sAiAwG+wIloxgTwiK54nOUfvuQGXJIeQBjRfGhJfr93N2tqWSuUxBTlB8w6gcv4=
=2dWz
-----END PGP SIGNATURE-----

Reply via email to