Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
react-observable-mixin
Advanced tools
Container like observable mixin for ReactJS.
npm install react-observable-mixin
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>;
}
});
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.
mixins: [RxObservableMixin]
You can implement this method and it will be called when a value is received from observable and that the state will be updated.
componentWillReceiveStateFromObservables(nextState) {
console.log(nextState.name); // new value
console.log(this.state.name); // previous value
}
You can implement this method and it will be called when an error is emitted from an observable.
componentWillReceiveErrorFromObservables(error) {
throw error; // Throw error emitted from an observable
}
A validator for Rx.Observable instance.
propTypes() {
return {
name$: ObservablePropTypes.observable
};
}
MIT
FAQs
This package is no longer supported and has been deprecated. To avoid malicious use, npm is hanging on to the package name.
We found that react-observable-mixin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.