Comparing version 0.4.1 to 1.0.0
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
var Busy, block, block_global, block_local, blocked, get, mab, mabs, main, reactivity, subscribe, unblock, util, x; | ||
var Busy, block, block_global, block_local, blocked, executors, get, mab, mabs, main, reactivity, subscribe, unblock, util, x; | ||
@@ -15,2 +15,4 @@ reactivity = require('reactivity'); | ||
executors = require('./executors'); | ||
/* | ||
@@ -60,2 +62,3 @@ options = | ||
unblock = function(func) { | ||
func = executors.sequence(func); | ||
return function() { | ||
@@ -65,3 +68,3 @@ var args, cb, _ref; | ||
func = mabs.attach(func); | ||
reactivity((function() { | ||
reactivity.subscribe((function() { | ||
return func.apply(null, args); | ||
@@ -157,12 +160,24 @@ }), function(e, r, monitor, stopper) { | ||
if ((typeof module !== "undefined" && module !== null) && (module.exports != null)) { | ||
x = module.exports = main; | ||
x.sync = block; | ||
x.async = unblock; | ||
x.revert = unblock; | ||
x.busy = blocked; | ||
x.get = get; | ||
x.subscribe = subscribe; | ||
if ((typeof module !== "undefined" && module !== null ? module.exports : void 0) != null) { | ||
module.exports = main; | ||
} | ||
x = main; | ||
x.revert = unblock; | ||
x.busy = blocked; | ||
x.get = get; | ||
x.subscribe = subscribe; | ||
x.parallel = function(f) { | ||
return executors.parallel(f)(); | ||
}; | ||
x.sequence = function(f) { | ||
return executors.sequence(f)(); | ||
}; | ||
if (typeof window !== "undefined" && window !== null) { | ||
@@ -169,0 +184,0 @@ window.syncify = main; |
// Generated by CoffeeScript 1.6.3 | ||
(function() { | ||
var Busy, rcell, util, | ||
var Busy, executors, reactivity, util, | ||
__hasProp = {}.hasOwnProperty; | ||
rcell = require('reactive-cell'); | ||
util = require('./util'); | ||
@@ -12,2 +10,6 @@ | ||
reactivity = require('reactivity'); | ||
executors = require('./executors'); | ||
/* | ||
@@ -30,3 +32,3 @@ | ||
cache = {}; | ||
blocked_f = function() { | ||
blocked_f = executors.sequence(function() { | ||
var args, _name; | ||
@@ -36,8 +38,13 @@ args = util.arr(arguments); | ||
var c; | ||
c = rcell(); | ||
c(new Busy); | ||
util.apply(async_func, args, c.callback); | ||
c = reactivity(new Busy); | ||
util.apply(async_func, args, function(e, r) { | ||
if (e != null) { | ||
return c(e); | ||
} else { | ||
return c(r); | ||
} | ||
}); | ||
return c; | ||
})())(); | ||
}; | ||
}); | ||
blocked_f.reset = function() { | ||
@@ -44,0 +51,0 @@ var cell, k, old_cache, _results; |
{ | ||
"name": "syncify", | ||
"version": "0.4.1", | ||
"version": "1.0.0", | ||
"description": "", | ||
@@ -24,5 +24,4 @@ "author": "Aldo Bucchi <aldo.bucchi@gmail.com>", | ||
"stackval": "0.2.1", | ||
"reactive-cell": "~1.0.0", | ||
"reactivity": "~1.3.1" | ||
"reactivity": "~2.0.2" | ||
} | ||
} |
@@ -19,8 +19,8 @@ # Syncify.js | ||
// ( we temporarily bring them to the sync world using black magic ) | ||
var getFriendIds = syncify getFriendIdsFromServer | ||
var getFirstName = syncify getFirstNameFromServer | ||
var getLastName = syncify getLastNameFromServer | ||
var getFriendIds = syncify( getFriendIdsFromServer ) | ||
var getFirstName = syncify( getFirstNameFromServer ) | ||
var getLastName = syncify( getLastNameFromServer ) | ||
// and we can now combine them using clean, synchronous imperative code | ||
function getFriendNames( id, cb ){ | ||
function getFriendNames( id ){ | ||
var names = []; | ||
@@ -39,3 +39,3 @@ var friendIds = getFriendIds( id ); | ||
// in order to call it | ||
var getFriendNamesFromServer = syncify.async getFriendNames | ||
var getFriendNamesFromServer = syncify.async( getFriendNames ) | ||
@@ -42,0 +42,0 @@ // voila! |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
18890
3
11
591
1
0
+ Addedreactivity@2.0.2(transitive)
- Removedreactive-cell@~1.0.0
- Removedreactive-cell@1.0.0(transitive)
- Removedreactivity@1.3.4(transitive)
Updatedreactivity@~2.0.2