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

react-observable-mixin

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-observable-mixin - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

65

package.json
{
"name": "react-observable-mixin",
"version": "2.0.0",
"description": "Container like observable mixin for ReactJS.",
"main": "lib/index.js",
"files": [
"lib"
],
"dependencies": {
"rx-lite": "^4.0.6",
"shallowequal": "^0.2.2"
},
"devDependencies": {
"@doctolib/gulp-tasks": "^5.0.0",
"babel-eslint": "^6.0.2",
"babel-preset-doctolib": "^2.0.0",
"chai": "^3.3.0",
"eslint": "^2.8.0",
"eslint-config-doctolib": "^2.0.0",
"eslint-plugin-mocha": "^2.2.0",
"eslint-plugin-react": "^5.0.1",
"gulp": "^3.9.0",
"jsdom": "^8.4.0",
"mocha": "^2.3.3",
"mocha-jsdom": "^1.0.0",
"react": "^15.0.1",
"react-addons-pure-render-mixin": "^15.0.1",
"react-addons-test-utils": "^15.0.1",
"react-dom": "^15.0.1",
"react-prism": "^3.0.0",
"react-pure-render": "^1.0.2",
"sinon": "^1.17.1",
"sinon-chai": "^2.8.0"
},
"version": "3.0.0",
"description": "",
"main": "index.js",
"scripts": {
"cover": "gulp cover",
"coveralls": "gulp coveralls",
"travis": "npm run lint && npm run coveralls",
"lint": "eslint .",
"test": "gulp test"
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/doctolib/react-observable-mixin.git"
"url": "git+https://github.com/npm/deprecate-holder.git"
},
"keywords": [
"react",
"reactjs",
"react",
"mixin",
"rx",
"frp",
"flux",
"container"
],
"author": "Doctolib <tech@doctolib.fr>",
"license": "MIT",
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/doctolib/react-observable-mixin/issues"
"url": "https://github.com/npm/deprecate-holder/issues"
},
"examples": {
"codeHighlighting": true,
"title": "React Observable Mixin"
},
"homepage": "https://github.com/doctolib/react-observable-mixin#readme"
"homepage": "https://github.com/npm/deprecate-holder#readme"
}

@@ -1,83 +0,5 @@

# react-observable-mixin
[![Build Status](https://travis-ci.org/doctolib/react-observable-mixin.svg?branch=master)](https://travis-ci.org/doctolib/react-observable-mixin)
[![Coverage Status](https://coveralls.io/repos/doctolib/react-observable-mixin/badge.svg?branch=master&service=github)](https://coveralls.io/github/doctolib/react-observable-mixin?branch=master)
[![Dependency Status](https://david-dm.org/doctolib/react-observable-mixin.svg?theme=shields.io)](https://david-dm.org/doctolib/react-observable-mixin)
[![devDependency Status](https://david-dm.org/doctolib/react-observable-mixin/dev-status.svg?theme=shields.io)](https://david-dm.org/doctolib/react-observable-mixin#info=devDependencies)
# Deprecated Package
Container like observable mixin for ReactJS.
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
## Install
```
npm install react-observable-mixin
```
## Usage
```js
import React from 'react';
import {ObservablePropTypes, RxObservableMixin} from 'react-observable-mixin';
export default React.createClass({
mixins: [RxObservableMixin],
propTypes: {
name$: ObservablePropTypes.observable,
lastName$: ObservablePropTypes.observable
},
render() {
return <span>{this.state.name || ''} {this.state.lastName || ''}</span>;
}
});
```
### Mixins
#### RxObservableMixin
This mixin automatically subscribes to props that are observables (`$` at the end and a method subscribe). When the observable emits a new value, the value is automatically injected in the state.
```js
mixins: [RxObservableMixin]
```
##### componentWillReceiveStateFromObservables(state)
You can implement this method and it will be called when a value is received from observable and that the state will be updated.
```js
componentWillReceiveStateFromObservables(nextState) {
console.log(nextState.name); // new value
console.log(this.state.name); // previous value
}
```
##### componentWillReceiveErrorFromObservables(error)
You can implement this method and it will be called when an error is emitted from an
observable.
```js
componentWillReceiveErrorFromObservables(error) {
throw error; // Throw error emitted from an observable
}
```
### PropTypes
#### ObservablePropTypes.observable
A validator for Rx.Observable instance.
```js
propTypes() {
return {
name$: ObservablePropTypes.observable
};
}
```
## License
MIT
Please contact support@npmjs.com if you have questions about this package.
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