
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
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.
The npm package react-observable-mixin receives a total of 3 weekly downloads. As such, react-observable-mixin popularity was classified as not popular.
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
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.