react-observable-mixin
Advanced tools
Comparing version 2.0.0 to 3.0.0
{ | ||
"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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
0
0
685
2
0
6
2
- Removedrx-lite@^4.0.6
- Removedshallowequal@^0.2.2
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedrx-lite@4.0.8(transitive)
- Removedshallowequal@0.2.2(transitive)