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.
@mighty-justice/smart-bool
Advanced tools
"mobx": ">=5.8"
npm install --save-dev @mighty-justice/smart-bool
yarn add --dev @mighty-justice/smart-bool
get isTrue // Value
set(value: boolean) // Sets new value
setTrue() // Sets value to true
setFalse() // Sets value to false
toggle() // Toggles value
until(promise) // Waits for promise, then sets value to true and returns promise
saving(label: string) // Returns label is false, 'Saving...' if true. Useful for buttons.
import React, { Component } from 'react';
import axios from 'axios';
import { observer } from 'mobx-react';
import SmartBool from '@mighty-justice/smart-bool';
@observer
class Autofac extends Component<{}> {
private isLoading = SmartBool(true);
private isMilkPizzled = SmartBool(); // Defaults to false
constructor (props: {}) {
super(props);
this.waitForTrain();
}
private async waitForTrain () {
// this.isLoading.isTrue == true;
// this.isMilkPizzled.isTrue == false;
// Sets bool to true until a promise returns.
const request = axios.get('/train/');
// this.isLoading.isTrue == true;
const response = await this.isLoading.until(request);
// this.isLoading.isTrue == false;
// Simple setter
this.isMilkPizzled.set(true);
// Helper method useful for JSX props
this.isMilkPizzled.setTrue();
}
public render () {
return (
<div>
<p>Waiting for train: {this.isLoading.isTrue}</p>
<p>Claiming is pizzled: {this.isMilkPizzled.isTrue}</p>
</div>
)
}
}
FAQs
Eliminate your single-line boolean setting methods
The npm package @mighty-justice/smart-bool receives a total of 4 weekly downloads. As such, @mighty-justice/smart-bool popularity was classified as not popular.
We found that @mighty-justice/smart-bool demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 open source maintainers 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.