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

cycle-gear

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cycle-gear - npm Package Compare versions

Comparing version 4.0.0-alpha.1 to 4.0.0-alpha.3

8

dist-es2015/index.d.ts

@@ -1,2 +0,2 @@

import { Stream } from 'xstream';
import { Observable } from 'xstream';
export interface GearView<TModel> {

@@ -13,8 +13,8 @@ (model: TModel): any;

export interface Gear<TActions, TModel> {
catch?: (error: any, actions: TActions) => Stream<any>;
catch?: (error: any, actions: TActions) => Observable<any>;
intent?: (sources: any) => TActions;
model?: (actions: TActions) => Stream<TModel>;
model?: (actions: TActions) => Observable<TModel>;
teeth?: GearTeeth<TModel>;
}
export declare type Transmission = ((sources: any) => Stream<Gear<any, any>>) | Stream<Gear<any, any>>;
export declare type Transmission = ((sources: any) => Observable<Gear<any, any>>) | Observable<Gear<any, any>>;
export interface PedalOptions {

@@ -21,0 +21,0 @@ defaultGear?: Gear<any, any>;

@@ -50,6 +50,7 @@ import { adapt } from '@cycle/run/lib/adapt';

}
const spin = gear.map(gear => {
const spin = xs.fromObservable(gear)
.map(gear => {
const actions = gear.intent ? gear.intent(sources) : defaultIntent(sources);
const state = (gear.model ? gear.model(actions) : defaultModel(actions))
.replaceError((err) => gear.catch ? gear.catch(err, actions) : defaultCatch(err, actions))
const state = xs.fromObservable(gear.model ? gear.model(actions) : defaultModel(actions))
.replaceError((err) => xs.fromObservable(gear.catch ? gear.catch(err, actions) : defaultCatch(err, actions)))
.remember();

@@ -56,0 +57,0 @@ const views = teeth.reduce((accum, tooth) => Object.assign(accum, {

@@ -1,2 +0,2 @@

import { Stream } from 'xstream';
import { Observable } from 'xstream';
export interface GearView<TModel> {

@@ -13,8 +13,8 @@ (model: TModel): any;

export interface Gear<TActions, TModel> {
catch?: (error: any, actions: TActions) => Stream<any>;
catch?: (error: any, actions: TActions) => Observable<any>;
intent?: (sources: any) => TActions;
model?: (actions: TActions) => Stream<TModel>;
model?: (actions: TActions) => Observable<TModel>;
teeth?: GearTeeth<TModel>;
}
export declare type Transmission = ((sources: any) => Stream<Gear<any, any>>) | Stream<Gear<any, any>>;
export declare type Transmission = ((sources: any) => Observable<Gear<any, any>>) | Observable<Gear<any, any>>;
export interface PedalOptions {

@@ -21,0 +21,0 @@ defaultGear?: Gear<any, any>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var adapt_1 = require("@cycle/run/lib/adapt");

@@ -56,6 +57,7 @@ var xstream_1 = require("xstream");

}
var spin = gear.map(function (gear) {
var spin = xstream_1.default.fromObservable(gear)
.map(function (gear) {
var actions = gear.intent ? gear.intent(sources) : defaultIntent(sources);
var state = (gear.model ? gear.model(actions) : defaultModel(actions))
.replaceError(function (err) { return gear.catch ? gear.catch(err, actions) : defaultCatch(err, actions); })
var state = xstream_1.default.fromObservable(gear.model ? gear.model(actions) : defaultModel(actions))
.replaceError(function (err) { return xstream_1.default.fromObservable(gear.catch ? gear.catch(err, actions) : defaultCatch(err, actions)); })
.remember();

@@ -62,0 +64,0 @@ var views = teeth.reduce(function (accum, tooth) {

import { adapt } from '@cycle/run/lib/adapt'
import xs, { Stream } from 'xstream'
import xs, { Stream, Observable } from 'xstream'

@@ -18,9 +18,9 @@ export interface GearView<TModel> {

export interface Gear<TActions, TModel> {
catch?: (error: any, actions: TActions) => Stream<any>
catch?: (error: any, actions: TActions) => Observable<any>
intent?: (sources: any) => TActions
model?: (actions: TActions) => Stream<TModel>
model?: (actions: TActions) => Observable<TModel>
teeth?: GearTeeth<TModel>
}
export type Transmission = ((sources: any) => Stream<Gear<any, any>>) | Stream<Gear<any, any>>
export type Transmission = ((sources: any) => Observable<Gear<any, any>>) | Observable<Gear<any, any>>

@@ -77,3 +77,3 @@ export interface PedalOptions {

return (sources: any) => {
let gear: Stream<Gear<any, any>>
let gear: Observable<Gear<any, any>>
if (transmission instanceof Function) {

@@ -85,14 +85,15 @@ gear = transmission(sources)

const spin = gear.map(gear => {
const actions = gear.intent ? gear.intent(sources) : defaultIntent(sources)
const state = (gear.model ? gear.model(actions) : defaultModel(actions))
.replaceError((err: any) => gear.catch ? gear.catch(err, actions) : defaultCatch(err, actions))
.remember()
const views = teeth.reduce((accum, tooth) => Object.assign(accum, {
[tooth]: state.filter(toothFilter(tooth, gear.teeth[tooth])).map(toothView(tooth, gear.teeth[tooth]))
}),
{})
const spin = xs.fromObservable<Gear<any, any>>(gear)
.map(gear => {
const actions = gear.intent ? gear.intent(sources) : defaultIntent(sources)
const state = xs.fromObservable(gear.model ? gear.model(actions) : defaultModel(actions))
.replaceError((err: any) => xs.fromObservable(gear.catch ? gear.catch(err, actions) : defaultCatch(err, actions)))
.remember()
const views = teeth.reduce((accum, tooth) => Object.assign(accum, {
[tooth]: state.filter(toothFilter(tooth, gear.teeth[tooth])).map(toothView(tooth, gear.teeth[tooth]))
}),
{})
return views
})
return views
})
.startWith(emptyTeeth)

@@ -99,0 +100,0 @@ .remember()

{
"name": "cycle-gear",
"version": "4.0.0-alpha.1",
"version": "4.0.0-alpha.3",
"description": "Main function factory for CycleJS",

@@ -23,3 +23,3 @@ "main": "dist/index.js",

"compile": "tsc -p tsconfig.es2015.json && tsc -p tsconfig.json",
"prepublish": "npm run compile"
"version": "npm run compile"
},

@@ -39,3 +39,7 @@ "repository": {

"typescript": "^2.1.5"
},
"dependencies": {
"@cycle/run": "^3.1.0",
"xstream": "^10.6.0"
}
}
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