百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

mirror

> 前端框架
开源

一个简单而强大的 React 框架, API 少, 无任何模板。

1.4K stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个简单而强大的 React 框架, API 少, 无任何模板。

Mirror

查看中文

A simple and powerful React framework with minimal API and zero boilerplate. (Inspired by dva and jumpstate)

Painless React and Redux.

Why?

We love React and Redux.

A typical React/Redux app looks like the following:

  • An actions/ directory to manually create all action types (or action creators)
  • A reducers/ directory and tons of switch clause to capture all action types
  • Apply middlewares to handle async actions
  • Explicitly invoke dispatch method to dispatch all actions
  • Manually create history to router and/or sync with store
  • Invoke methods in history or dispatch actions to programmatically changing routes

The problem? Too much boilerplates and a little bit tedious.

In fact, most part of the above steps could be simplified. Like, create actions and reducers 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.

Features

  • Minimal API(only 4 newly introduced)
  • Easy to start
  • Actions done easy, sync or async
  • Support code splitting
  • Full-featured hook mechanism

Getting Started

Creating an App

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

…

Demo

Guide

See Guide.

API

See API Reference.

Examples

  • User-Dashboard (An example similar to dva-user-dashboard)
  • Counter
  • Simple-Router
  • Todo

Change log

See CHANGES.md.

FAQ

Does Mirror support TypeScript?

Yes, it does.

Does Mirror support Redux DevTools Extension?

Yes, Mirror integrates Redux DevTools by default to make your debugging more easily.

Can I use extra Redux middlewares?

Yes, specify them in mirror.defaults is all you need to do, learn more from the Docs.

I'm really into Redux-Saga, is there any way to use it in Mirror?

Yes of course, take a look at the addEffect option.

Which version of react-router does Mirror use?

react-router v4.

GitHub Issues· 31 开放

在 GitHub 查看全部
  • #122

    @types/mirrorx 可否更新到最新版本呢

    更新于 2021年12月31日
  • #128

    如何剥离react-router v4的路由

    更新于 2021年6月10日

核心特点

  • •An actions/ directory to manually create all action types (or action creators)
  • •A reducers/ directory and tons of switch clause to capture all action types
  • •Apply middlewares to handle async actions
  • •Explicitly invoke dispatch method to dispatch all actions
  • •Manually create history to router and/or sync with store
  • •Invoke methods in history or dispatch actions to programmatically changing routes
  • •Minimal API(only 4 newly introduced)
  • •Easy to start
  • •Actions done easy, sync or async
  • •Support code splitting

> 标签

JavaScriptmirrorreactreact-frameworkreact-router

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类前端框架
定价开源

> 相关工具

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架