angular-faye icon indicating copy to clipboard operation
angular-faye copied to clipboard

Adds faye initialization options. Fixes #2

Open blackxored opened this issue 11 years ago • 5 comments

Allow passing initialization options to faye constructor invocation.

blackxored avatar May 06 '14 14:05 blackxored

Thanks, but isn't the https://github.com/monterail/angular-faye#configure-faye-client enough? Besides that, $faye takes now three parameters: url, fun, opts so $faye("url", {...}) syntax will not work.

teamon avatar May 07 '14 13:05 teamon

I'm not sure what part of that syntax won't work, the third parameter is optional. The callback invocation (yield client) should also work as well. This is for initialization, under some cases I might want to initialize vs edit it later, poor argument but in the async world you never know :trollface:

blackxored avatar May 07 '14 13:05 blackxored

I mean:

$faye = (url, fun, opts = {}) -> ...

$faye("some url", { my: opt }) 
# inside:
url == "some url"
fun == { my: opt }
opts == {}

teamon avatar May 08 '14 08:05 teamon

Actually no, iirc correctly you're using "?()" right, existential operator, that should parameter checking so if fun is not a function it will work correctly. Thanks.

blackxored avatar May 08 '14 19:05 blackxored

But if you pass options as second parameter then variable fun will hold those options and options variable will be empty hash so options will not be applied and fun not executed

teamon avatar May 09 '14 10:05 teamon