Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
redux-fluent
Advanced tools
Tiny and eloquent way to manage a redux-like state manager (~3K, dependencies free, definitions included).
Redux is great, every recent web application has most likely been built on top of it. How can we make it even better?
Action
, Action Type
and Action Creator
could all be implemented in a single entity: Let's introduce Redux Fluent Actions.error: boolean
field, which indicates whether the action represents a failure or not. Respecting this pattern leads to a series of if statements inside reducers, compromising both readability and maintainability, so the community normally tends to split error and failures into two separate actions (eg: ADD_TODO_SUCCESS
and ADD_TODO_ERROR
) which reduces cognitive complexity on one hand but produces even more boilerplate on the other. Let's embrace FSA and abstract error handling with filterable action handlers.yarn add redux-fluent
/** todos.actions.js **/
import { createAction } from 'redux-fluent';
export const addTodo = createAction('todos | add');
/** todos.reducer.js **/
import { createReducer, ofType } from 'redux-fluent';
import * as actions from './todos.actions.js';
const addTodo = (state, { payload }) => state.concat(payload);
export const todos = createReducer('todos')
.actions(
ofType(actions.addTodo).map(addTodo),
/* and so on */
)
.default(() => []);
/** application.js **/
import { createStore } from 'redux';
import { combineReducers } from 'redux-fluent';
import * as actions from './todos.actions.js';
import { todos } from './todos.reducer.js';
const rootReducer = combineReducers(todos, ...);
const store = createStore(rootReducer);
store.getState(); // { todos: [] }
store.dispatch(actions.addTodo('1'));
store.getState(); // { todos: [1] }
FAQs
A Practical and Functional utility for redux
The npm package redux-fluent receives a total of 8 weekly downloads. As such, redux-fluent popularity was classified as not popular.
We found that redux-fluent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.