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

cycle-react

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cycle-react - npm Package Versions

23

7.0.0

Diff

Changelog

Source

7.0.0

Breaking Changes

  • API is completed changed to support Hooks
  • React v16.8 or above is required
  • Support only RxJS 6 now

Migration

Almost everything for cycle-react has changed. If you're migrating your current cycle-react application to 7.0, probably jsx and model are the only parts that can be reused.

Please check examples for migration guide.

minamo
published 6.0.1 •

Changelog

Source

6.0.1

New Features

  • Support for RxJS 5 has been implemented.
  • cycle-react now takes the advantage of React v16. Default element for empty Observable has been changed from <div /> to empty fragment.

Breaking Changes

  • React v16 or above is required for cycle-react v6.
  • props.get and props.getAll are removed. Use pluck instead.
  • dispose from definitionFn is renamed to unsubscribe.
  • rootTagName is removed. Default element is now empty fragment [].

Migration

For migrating RxJS v4 to v5, see https://github.com/ReactiveX/rxjs/blob/master/MIGRATION.md for details.

import
OLD
import {component} from 'cycle-react';
NEW
// RxJS v4
import {component} from 'cycle-react/rx';
// RxJS v5
import {component} from 'cycle-react/rxjs';
minamo
published 6.0.0-beta1 •

minamo
published 5.1.2 •

Changelog

Source

5.1.2

Compatibility fix for create-react-app and react-scripts

The NPM package cycle-react now contains transpiled code that built by Babel. This fixes react-scripts build's compatibility issue with ES6.

The underlying component class has been changed from PureComponent to Component, due to implementation of shouldComponentUpdate raises warning message for PureComponent.

minamo
published 5.1.1 •

minamo
published 5.1.0 •

minamo
published 5.0.0 •

Changelog

Source

5.0.0

Breaking change: Custom events is now subscribed only when listener props is provided upon componentDidMountEvent [#37]

For example, if you have following component:

<MyTimer />

And you add the event listener after the component has mounted:

<MyTimer onTick={listener('x')} />

The onTick event will be no longer raised for this cycle-react version.

Breaking change: mixin is removed along with the usage of createClass

Breaking change: self and renderScheduler have been removed

As a result, lifecycles parameter has moved to the third parameter of definitionFn. For handling refs, please use interactions for generating callback function.

See "Working with React" for further details.

Breaking change: cycle-react is now native ES6

Use any transplier if you need backward compatibility for cycle-react. If you are using Babel already you should have no problem.

In addition, the following features are not used in cycle-react to ensure minimum dependency and good efficiency for all browsers.

  • Async
  • Iterators and generators
  • Symbol
  • for..of
  • Destructuring assignment
  • Default, spread and rest parameters
  • Promise

You can still use any of the features above in your project with cycle-react. In fact, using destructuring assignment with cycle-react is recommended.

  • Preview: View component

View component is a new way to define cycle-react components by divorcing view function from the component. For example, the original component function allows you to define the component like this:

component('Hello', (interactions) =>
  interactions.get('OnNameChanged')
    .map(ev => ev.target.value)
    .startWith('')
    .map(name =>
      <div>
        <label>Name:</label>
        <input type="text" onChange={interactions.listener('OnNameChanged')} />
        <hr />
        <h1>Hello {name}</h1>
      </div>
    )
);

New view component extracts the view function out of component definition:

viewComponent(
  'Hello',
  (interactions) =>
    interactions.get('OnNameChanged')
      .map(ev => ev.target.value)
      .startWith(''),
  // View function
  (name, {OnNameChanged}) => (
    <div>
      <label>Name:</label>
      <input type="text" onChange={OnNameChanged} />
      <hr />
      <h1>Hello {name}</h1>
    </div>
  )
);
minamo
published 5.0.0-alpha.0 •

minamo
published 4.0.0 •

Changelog

Source

4.0.0

Breaking change: rx is a peer dependency now [#21]

Breaking change: The shortcut for React and Rx are both removed [#21]

Add feature: Added render scheduler for supporting refs, see working-with-react.md for the details [#23]

Fix: The feature of using function wrapper for view is no longer deprecated [#23]

Fix: The onCompleted signal will be emitted for all lifecycle observables before the component being unmounted

minamo
published 3.1.0 •

Changelog

Source

3.1.0

Add feature: Support lifecycle events by the fourth parameter lifecycles for the component's definitionFn. [#18]

See working-with-react.md for details.

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