diff --git a/Documentation/FAQ.md b/Documentation/FAQ.md index fb8b45466..38fa7a2e2 100644 --- a/Documentation/FAQ.md +++ b/Documentation/FAQ.md @@ -174,6 +174,30 @@ func foo() -> Promise Who chooses when this promise starts? The answer is: Alamofire does and in this case, it “starts” immediately when `foo()` is called. +## What is a good way to use Firebase with PromiseKit + +There is no good way to use Firebase with PromiseKit. See the next question for rationale. + +The best option is to embed your chain in your firebase handler: + +``` +foo.observe(.value) { snapshot in + firstly { + bar(with: snapshot) + }.then { + baz() + }.then { + baffle() + }.catch { + //… + } +} +``` + +## I need my `then` to fire multiple times + +Then we’re afraid thgat you cannot use PromiseKit for that event. Promises only resolve `once`, this is the fundamental nature of promises and is considered a feature since it gives you guarantees about the flow of your chains. + ## My question was not answered [Please open a ticket](https://github.com/mxcl/PromiseKit/issues/new).