Skip to content
This repository was archived by the owner on Jun 5, 2020. It is now read-only.

Adds faye initialization options. Fixes #2#5

Open
blackxored wants to merge 4 commits intomonterail:masterfrom
blackxored:faye-options
Open

Adds faye initialization options. Fixes #2#5
blackxored wants to merge 4 commits intomonterail:masterfrom
blackxored:faye-options

Conversation

@blackxored
Copy link

Allow passing initialization options to faye constructor invocation.

@teamon
Copy link
Contributor

teamon commented May 7, 2014

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.

@blackxored
Copy link
Author

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:

@teamon
Copy link
Contributor

teamon commented May 8, 2014

I mean:

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

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

@blackxored
Copy link
Author

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.

@teamon
Copy link
Contributor

teamon commented May 9, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants