Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Side-effect manager for redux
npm install --save effector
Or using yarn
yarn add effector
import {createStore, applyMiddleware} from 'redux'
import {
createRootDomain,
createReducer,
joint,
type Domain,
type Event,
type Effect,
effectorMiddleware,
} from 'effector'
const domain: Domain<Store> = createRootDomain()
const changeText: Event<string> = domain.event('change todo text')
const clickSave = domain.event('click save')
const toggleComplete = domain.event('toggle complete')
const resetForm = domain.event('reset form')
const addTodo: Event<{text: string, complete: boolean}> =
domain.event('add todo')
const fetchSaveTodo: Effect<Todo, 'saved', Error> =
domain.effect('save request')
const todos = createReducer([])
.on(fetchSaveTodo.done, (state, {params}) => [
...state,
params,
])
const form = createReducer({
text: '',
complete: false,
}).reset(resetForm)
.on(changeText, (state, text) => ({
...state,
text,
}))
.on(toggleComplete, state => ({
...state,
complete: !state.complete,
}))
fetchSaveTodo.use(
params => fetch(params)
)
fetchSaveTodo.done.watch(() => resetForm())
clickSave.epic(
(data$, state$) => state$
.sampleWith(data$)
.throttle(500)
.map(({form}) => form)
.map(addTodo)
)
addTodo.watch(
(params, state) => fetchSaveTodo({
text: params.text,
complete: params.complete,
date: new Date(),
})
)
const stateReducer: Reducer<Store> = joint(
(form, todos) => ({form, todos}),
form,
todos,
)
const store = createStore(
stateReducer,
applyMiddleware(effectorMiddleware),
)
domain.register(store)
type Store = {
todos: Todo[],
form: {
text: string,
complete: boolean,
},
}
type Todo = {
text: string,
date: Date,
complete: boolean,
}
import {
effectorMiddleware,
rootDomain,
createReducer,
joint,
} from 'effector'
import type {Domain, Event, Effect, Reducer} from 'effector'
0.11.0
.use
effectImplementationCheck
to unused
FAQs
Business logic with ease
The npm package effector receives a total of 39,599 weekly downloads. As such, effector popularity was classified as popular.
We found that effector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
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.