This repository was archived by the owner on Mar 17, 2025. It is now read-only.
Commit d6f09ba
committed
utils: add makeNodeResolver function.
Many Firebase methods take Node.js style callbacks where the first
argument is null do indicate success or contains error information.
Angular uses promises to handle asyncronous flow. The original
[Q](https://github.com/kriskowal/q) library by kriskowal (upon which
had Angular promises are based) had a `makeNodeResolver` function
that eased integration of the two different async flows.
This utility function replicates that feature. Usage is as follows:
```javascript
var defer = $q.defer();
ref.resetPassword(
{email:'[email protected]'},
$util.makeNodeResolver(defer) //automatically resolves/rejects promise
);
defer.promise.then(...) // use the promise as you normally would
```1 parent b1de5aa commit d6f09ba
2 files changed
+35
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
230 | 241 | | |
231 | 242 | | |
232 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
181 | 181 | | |
182 | 182 | | |
183 | 183 | | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
184 | 208 | | |
0 commit comments