Comparing version 0.4.0 to 0.4.1
var _ = require('underscore') | ||
, events = require('eventemitter2') | ||
, keys = require('./bjorling-keys') | ||
, http = require('./http') | ||
, projections = {} | ||
, projectionDataLocations = {} | ||
, notFounds = {} | ||
, http | ||
, dataUrl | ||
@@ -31,2 +31,3 @@ | ||
function processQuery(projectionName, queriedValue, data, cb) { | ||
console.log(arguments) | ||
if(queriedValue) { | ||
@@ -86,2 +87,8 @@ immediateResult(projectionName, queriedValue, cb) | ||
function initialLoad(projectionName, cb) { | ||
process.nextTick(function() { | ||
cb(null, 0) | ||
}) | ||
} | ||
function load(projectionName) { | ||
@@ -106,3 +113,3 @@ function handleResponse(res) { | ||
, url = http.getUrl(dataLocation.action, data) | ||
function handleResponse(res) { | ||
@@ -159,3 +166,8 @@ res.on('end', function(resData) { | ||
function eventResult(projectionName, position, state, cb) { | ||
save(projectionName, state, cb) | ||
} | ||
module.exports = emitter | ||
module.exports.eventResult = eventResult | ||
module.exports.filter = filter | ||
@@ -165,2 +177,3 @@ module.exports.getByKey = getByKey | ||
module.exports.getState = getState | ||
module.exports.initialLoad = initialLoad | ||
module.exports.load = load | ||
@@ -173,1 +186,4 @@ module.exports.remove = remove | ||
} | ||
module.exports.setHttp = function(toSet) { | ||
http = toSet | ||
} |
@@ -104,2 +104,5 @@ var path = require('path') | ||
subscriptionFactory = opts.subscriptionFactory | ||
if(opts.http) { | ||
storage.setHttp(opts.http) | ||
} | ||
} | ||
@@ -106,0 +109,0 @@ module.exports.getProjection = function(projectionName, cb) { |
@@ -33,3 +33,3 @@ { | ||
, "main": "./bjorling.js" | ||
, "version": "0.4.0" | ||
, "version": "0.4.1" | ||
} |
17670
513