Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

syncify

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

syncify - npm Package Compare versions

Comparing version 0.4.1 to 1.0.0

lib/executors.js

35

lib/index.js
// 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc