Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Flux using RxJS, advocating but not strictly enforcing immutable data structures
Following the tradition of ridiculously titled Flux variations, I'm proud to announce Flurx.
Flux using RxJS, advocating but not strictly enforcing immutable data structures.
It's a very thin wrapper around Rx.Subject
for Actions and Rx.BehaviorSubject
for Stores,
basically adding only two methods:
In a nutshell:
npm install flurx
import React from 'react';
import {Store, Action} from 'flurx';
const LoginAction = Action.create();
const LoginActionSuccess = Action.create();
const LoginActionFailure = Action.create();
class LoginStore extends Store {
constructor() {
super({
isLoggedIn: false,
username: null,
warn: null
});
this.register(LoginAction, this.onLogin);
this.register(LoginActionSuccess, this.onLoginSuccess);
this.register(LoginActionFailure, this.onLoginFailure);
}
onLogin(store, username, password) {
if (!store.isLoggedIn) {
getJSON('/login', {username, password})
.then(LoginActionSuccess)
.catch(LoginActionFailure);
return Object.assign(store, {
isLoggedIn: true,
username,
warn: null
});
}
return store;
}
onLoginSuccess(store, result) {
return Object.assign(store, {
isLoggedIn: true,
username: result.username
warn: null
});
}
onLoginFailure(store, err) {
return Object.assign(store, {
isLoggedIn: false,
username: null,
warn: err.message
})
}
}
const loginStore = new LoginStore();
const LoginComponent = React.createClass({
getInitialState() {
return loginStore.getValue();
},
componentDidMount() {
loginStore.subscribe(store => {
this.setState(store);
});
},
onSubmit(e) {
e.preventDefault();
const username = this.refs.username.getValue().trim();
const password = this.refs.password.getValue().trim();
if (!username || !password) {
return;
}
LoginAction(username, password);
},
render() {
return (
!this.state.isLoggedIn ?
<form method="GET" action="/login" onSubmit={this.onSubmit}>
{this.state.warn != null ? <p>{this.state.warn}</p> : null}
<input ref="username" name="username" type="text"/>
<input ref="password" name="password" type="password"/>
<button type="submit">Login</button>
</form> :
<p>Welcome, {this.state.username}.</p>
);
}
});
FAQs
Flux using RxJS, advocating but not strictly enforcing immutable data structures
The npm package flurx receives a total of 2 weekly downloads. As such, flurx popularity was classified as not popular.
We found that flurx 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
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.