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

@cycle/core

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cycle/core - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

80

dist/cycle.js
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Cycle = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
"use strict";
let Rx = require(`rx`);
var Rx = (typeof window !== "undefined" ? window['Rx'] : typeof global !== "undefined" ? global['Rx'] : null);
function makeSinkProxies(drivers) {
var sinkProxies = {};
for (var _name in drivers) {
if (drivers.hasOwnProperty(_name)) {
sinkProxies[_name] = new Rx.ReplaySubject(1);
let sinkProxies = {};
for (let name in drivers) {
if (drivers.hasOwnProperty(name)) {
sinkProxies[name] = new Rx.ReplaySubject(1);
}

@@ -18,6 +15,6 @@ }

function callDrivers(drivers, sinkProxies) {
var sources = {};
for (var _name2 in drivers) {
if (drivers.hasOwnProperty(_name2)) {
sources[_name2] = drivers[_name2](sinkProxies[_name2], _name2);
let sources = {};
for (let name in drivers) {
if (drivers.hasOwnProperty(name)) {
sources[name] = drivers[name](sinkProxies[name], name);
}

@@ -29,5 +26,5 @@ }

function attachDisposeToSinks(sinks, replicationSubscription) {
Object.defineProperty(sinks, "dispose", {
Object.defineProperty(sinks, `dispose`, {
enumerable: false,
value: function value() {
value: () => {
replicationSubscription.dispose();

@@ -41,5 +38,5 @@ }

return function dispose() {
for (var _name3 in sources) {
if (sources.hasOwnProperty(_name3) && typeof sources[_name3].dispose === "function") {
sources[_name3].dispose();
for (let name in sources) {
if (sources.hasOwnProperty(name) && typeof sources[name].dispose === `function`) {
sources[name].dispose();
}

@@ -51,3 +48,3 @@ }

function attachDisposeToSources(sources) {
Object.defineProperty(sources, "dispose", {
Object.defineProperty(sources, `dispose`, {
enumerable: false,

@@ -60,3 +57,3 @@ value: makeDisposeSources(sources)

function logToConsoleError(err) {
var target = err.stack || err;
let target = err.stack || err;
if (console && console.error) {

@@ -68,8 +65,8 @@ console.error(target);

function replicateMany(observables, subjects) {
return Rx.Observable.create(function (observer) {
var subscription = new Rx.CompositeDisposable();
setTimeout(function () {
for (var _name4 in observables) {
if (observables.hasOwnProperty(_name4) && subjects.hasOwnProperty(_name4) && !subjects[_name4].isDisposed) {
subscription.add(observables[_name4].doOnError(logToConsoleError).subscribe(subjects[_name4].asObserver()));
return Rx.Observable.create(observer => {
let subscription = new Rx.CompositeDisposable();
setTimeout(() => {
for (let name in observables) {
if (observables.hasOwnProperty(name) && subjects.hasOwnProperty(name) && !subjects[name].isDisposed) {
subscription.add(observables[name].doOnError(logToConsoleError).subscribe(subjects[name].asObserver()));
}

@@ -82,3 +79,3 @@ }

subscription.dispose();
for (var x in subjects) {
for (let x in subjects) {
if (subjects.hasOwnProperty(x)) {

@@ -93,3 +90,3 @@ subjects[x].dispose();

function isObjectEmpty(obj) {
for (var key in obj) {
for (let key in obj) {
if (obj.hasOwnProperty(key)) {

@@ -103,24 +100,24 @@ return false;

function run(main, drivers) {
if (typeof main !== "function") {
throw new Error("First argument given to Cycle.run() must be the 'main' " + "function.");
if (typeof main !== `function`) {
throw new Error(`First argument given to Cycle.run() must be the 'main' ` + `function.`);
}
if (typeof drivers !== "object" || drivers === null) {
throw new Error("Second argument given to Cycle.run() must be an object " + "with driver functions as properties.");
if (typeof drivers !== `object` || drivers === null) {
throw new Error(`Second argument given to Cycle.run() must be an object ` + `with driver functions as properties.`);
}
if (isObjectEmpty(drivers)) {
throw new Error("Second argument given to Cycle.run() must be an object " + "with at least one driver function declared as a property.");
throw new Error(`Second argument given to Cycle.run() must be an object ` + `with at least one driver function declared as a property.`);
}
var sinkProxies = makeSinkProxies(drivers);
var sources = callDrivers(drivers, sinkProxies);
var sinks = main(sources);
var subscription = replicateMany(sinks, sinkProxies).subscribe();
var sinksWithDispose = attachDisposeToSinks(sinks, subscription);
var sourcesWithDispose = attachDisposeToSources(sources);
let sinkProxies = makeSinkProxies(drivers);
let sources = callDrivers(drivers, sinkProxies);
let sinks = main(sources);
let subscription = replicateMany(sinks, sinkProxies).subscribe();
let sinksWithDispose = attachDisposeToSinks(sinks, subscription);
let sourcesWithDispose = attachDisposeToSources(sources);
return { sources: sourcesWithDispose, sinks: sinksWithDispose };
}
var Cycle = {
let Cycle = {
/**
* Takes an `main` function and circularly connects it to the given collection
* Takes a `main` function and circularly connects it to the given collection
* of driver functions.

@@ -143,3 +140,3 @@ *

*/
run: run
run
};

@@ -149,4 +146,3 @@

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1])(1)
});

@@ -114,3 +114,3 @@ "use strict";

/**
* Takes an `main` function and circularly connects it to the given collection
* Takes a `main` function and circularly connects it to the given collection
* of driver functions.

@@ -117,0 +117,0 @@ *

{
"name": "@cycle/core",
"version": "6.0.0",
"version": "6.0.1",
"author": "Andre Staltz",

@@ -23,2 +23,3 @@ "description": "A fully reactive JavaScript framework for Human-Computer Interaction",

"main": "lib/cycle.js",
"dependencies": {},
"peerDependencies": {

@@ -25,0 +26,0 @@ "rx": "*"

@@ -122,3 +122,3 @@ let Rx = require(`rx`)

/**
* Takes an `main` function and circularly connects it to the given collection
* Takes a `main` function and circularly connects it to the given collection
* of driver functions.

@@ -125,0 +125,0 @@ *

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