
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
A simple and powerful React framework with minimal API and zero boilerplate. (Inspired by dva and jumpstate)
Painless React and Redux.
We love React and Redux.
A typical React/Redux app looks like the following:
actions/
directory to manually create all action type
s (or action creator
s)reducers/
directory and tons of switch
clause to capture all action type
sasync action
sdispatch
method to dispatch all actionshistory
to router and/or sync with storehistory
or dispatch actions to programmatically changing routesThe problem? Too much boilerplates and a little bit tedious.
In fact, most part of the above steps could be simplified. Like, create action
s and reducer
s in a single method, or dispatch both sync and async actions by simply invoking a function without extra middleware, or define routes without caring about history
, etc.
That's exactly what Mirror does, encapsulates the tedious or repetitive work in very few APIs to offer a high level abstraction with efficiency and simplicity, and without breaking the pattern.
Use create-react-app to create an app:
$ npm i -g create-react-app
$ create-react-app my-app
After creating, install Mirror from npm:
$ cd my-app
$ npm i --save mirrorx
$ npm start
index.js
import React from 'react'
import mirror, {actions, connect, render} from 'mirrorx'
// declare Redux state, reducers and actions,
// all actions will be added to `actions`.
mirror.model({
name: 'app',
initialState: 0,
reducers: {
increment(state) { return state + 1 },
decrement(state) { return state - 1 }
},
effects: {
async incrementAsync() {
await new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, 1000)
})
actions.app.increment()
}
}
})
// connect state with component
const App = connect(state => {
return {count: state.app}
})(props => (
<div>
<h1>{props.count}</h1>
{/* dispatch the actions */}
<button onClick={() => actions.app.decrement()}>-</button>
<button onClick={() => actions.app.increment()}>+</button>
{/* dispatch the async action */}
<button onClick={() => actions.app.incrementAsync()}>+ Async</button>
</div>
)
)
// start the app,`render` is an enhanced `ReactDOM.render`
render(<App />, document.getElementById('root'))
See Guide.
See API Reference.
See CHANGES.md.
Yes, it does.
Yes, Mirror integrates Redux DevTools by default to make your debugging more easily.
Yes, specify them in mirror.defaults
is all you need to do, learn more from the Docs.
Yes of course, take a look at the addEffect
option.
react-router v4.
FAQs
A React framework with minimal API and zero boilerplate.
The npm package mirrorx receives a total of 159 weekly downloads. As such, mirrorx popularity was classified as not popular.
We found that mirrorx 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.