@cerebral/firebase
Advanced tools
Comparing version 3.2.2-1507746465045 to 3.3.0-1507792489576
@@ -12,3 +12,2 @@ 'use strict'; | ||
exports.createReturnPromise = createReturnPromise; | ||
exports.convertObjectWithTemplates = convertObjectWithTemplates; | ||
exports.noop = noop; | ||
@@ -170,14 +169,2 @@ exports.snapshotToArray = snapshotToArray; | ||
function convertObjectWithTemplates(obj, resolve) { | ||
if (resolve.isTag(obj)) { | ||
return resolve.value(obj); | ||
} | ||
return Object.keys(obj).reduce(function (convertedObject, key) { | ||
convertedObject[key] = resolve.value(obj[key]); | ||
return convertedObject; | ||
}, {}); | ||
} | ||
function noop() {} | ||
@@ -184,0 +171,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _helpers = require('../helpers'); | ||
var _tags = require('cerebral/tags'); | ||
@@ -17,3 +17,3 @@ function onChildAddedFactory(path, signal) { | ||
firebase.onChildAdded(resolve.value(path), resolve.path(signal), (0, _helpers.convertObjectWithTemplates)(options, resolve)); | ||
firebase.onChildAdded(resolve.value(path), resolve.path(signal), (0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.onChildAdded')); | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _helpers = require('../helpers'); | ||
var _tags = require('cerebral/tags'); | ||
@@ -17,3 +17,3 @@ function onChildChangedFactory(path, signal) { | ||
firebase.onChildChanged(resolve.value(path), resolve.path(signal), (0, _helpers.convertObjectWithTemplates)(options, resolve)); | ||
firebase.onChildChanged(resolve.value(path), resolve.path(signal), (0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.onChildChanged')); | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _helpers = require('../helpers'); | ||
var _tags = require('cerebral/tags'); | ||
@@ -17,3 +17,3 @@ function onChildRemovedFactory(path, signal) { | ||
firebase.onChildRemoved(resolve.value(path), resolve.path(signal), (0, _helpers.convertObjectWithTemplates)(options, resolve)); | ||
firebase.onChildRemoved(resolve.value(path), resolve.path(signal), (0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.onChildRemoved')); | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var _helpers = require('../helpers'); | ||
var _tags = require('cerebral/tags'); | ||
@@ -17,3 +17,3 @@ function onValueFactory(path, signal) { | ||
firebase.onValue(resolve.value(path), resolve.path(signal), (0, _helpers.convertObjectWithTemplates)(options, resolve)); | ||
firebase.onValue(resolve.value(path), resolve.path(signal), (0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.onValue')); | ||
} | ||
@@ -20,0 +20,0 @@ |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _tags = require('cerebral/tags'); | ||
function signInWithFacebookFactory() { | ||
@@ -18,3 +20,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return (0, _helpers.createReturnPromise)(firebase.signInWithFacebook((0, _helpers.convertObjectWithTemplates)(options, resolve)), path); | ||
return (0, _helpers.createReturnPromise)(firebase.signInWithFacebook((0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.signInWithFacebook')), path); | ||
} | ||
@@ -21,0 +23,0 @@ |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _tags = require('cerebral/tags'); | ||
function signInWithGithubFactory() { | ||
@@ -18,3 +20,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return (0, _helpers.createReturnPromise)(firebase.signInWithGithub((0, _helpers.convertObjectWithTemplates)(options, resolve)), path); | ||
return (0, _helpers.createReturnPromise)(firebase.signInWithGithub((0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.signInWithGithub')), path); | ||
} | ||
@@ -21,0 +23,0 @@ |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _tags = require('cerebral/tags'); | ||
function signInWithGoogleFactory() { | ||
@@ -18,3 +20,3 @@ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
return (0, _helpers.createReturnPromise)(firebase.signInWithGoogle((0, _helpers.convertObjectWithTemplates)(options, resolve)), path); | ||
return (0, _helpers.createReturnPromise)(firebase.signInWithGoogle((0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.signInWithGoogle')), path); | ||
} | ||
@@ -21,0 +23,0 @@ |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _tags = require('cerebral/tags'); | ||
function taskFactory(taskName) { | ||
@@ -18,3 +20,3 @@ var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return (0, _helpers.createReturnPromise)(firebase.task(resolve.value(taskName), (0, _helpers.convertObjectWithTemplates)(payload, resolve)), path); | ||
return (0, _helpers.createReturnPromise)(firebase.task(resolve.value(taskName), (0, _tags.convertObjectWithTemplates)(payload, resolve, 'firebase.task')), path); | ||
} | ||
@@ -21,0 +23,0 @@ |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _tags = require('cerebral/tags'); | ||
function updateFactory(updates) { | ||
@@ -16,3 +18,3 @@ function update(_ref) { | ||
return (0, _helpers.createReturnPromise)(firebase.update((0, _helpers.convertObjectWithTemplates)(updates, resolve)), path); | ||
return (0, _helpers.createReturnPromise)(firebase.update((0, _tags.convertObjectWithTemplates)(updates, resolve, 'firebase.update')), path); | ||
} | ||
@@ -19,0 +21,0 @@ |
@@ -9,2 +9,4 @@ 'use strict'; | ||
var _tags = require('cerebral/tags'); | ||
function valueFactory(valuePath) { | ||
@@ -18,3 +20,3 @@ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
return (0, _helpers.createReturnPromise)(firebase.value(resolve.value(valuePath), (0, _helpers.convertObjectWithTemplates)(options, resolve)), path); | ||
return (0, _helpers.createReturnPromise)(firebase.value(resolve.value(valuePath), (0, _tags.convertObjectWithTemplates)(options, resolve, 'firebase.value')), path); | ||
} | ||
@@ -21,0 +23,0 @@ |
@@ -1,6 +0,6 @@ | ||
import { Tag } from 'cerebral/tags' | ||
import { ResolveValue, Tag } from 'function-tree' | ||
type Action = any | ||
type TagOr<T> = Tag<T> | T | ||
type TagOr<T> = ResolveValue<T> | T | ||
@@ -7,0 +7,0 @@ export interface OnChildOptions { |
{ | ||
"name": "@cerebral/firebase", | ||
"version": "3.2.2-1507746465045", | ||
"version": "3.3.0-1507792489576", | ||
"description": "Firebase provider for Cerebral", | ||
@@ -29,7 +29,7 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"cerebral": "^3.2.1-1507746465045" | ||
"cerebral": "^3.3.0-1507792489576" | ||
}, | ||
"devDependencies": { | ||
"cerebral": "^3.2.1-1507746465045" | ||
"cerebral": "^3.3.0-1507792489576" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
183744
1855