MIT License

项目介绍

ctrlplusb/easy-peasy 是一个托管在 GitHub 上的开源项目,主要使用 JavaScript 编写,采用 MIT License 许可证,目前获得 5.0k 个 Star、183 次 Fork。

仓库全名
ctrlplusb/easy-peasy
开源许可证
MIT License
Star 数
5.0k
Fork 数
183
未关闭 Issue
2

README 摘要

  Vegetarian friendly state for React   v7 Beta — this release modernises Easy Peasy around React 19's concurrent primitives. The public store/model API is unchanged from v6 and the library is feature-complete, but the v7 line is still in beta — APIs may shift in response to feedback before the stable release. See the v6 → v7 upgrade guide for details, or view the v6 docs for the current stable release…

完整内容见 GitHub 原始 README 或本页 。

常见问题

easy-peasy 用什么语言开发?

主要使用 JavaScript 编写,采用 MIT License 许可证,目前有 5.0k 个 Star。

easy-peasy 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 easy-peasy 的源码?

可以直接克隆仓库:git clone https://github.com/ctrlplusb/easy-peasy.git,默认分支为 master;安装与运行步骤见仓库 README。

easy-peasy 最近还在维护吗?

仓库最近一次更新为 6月30日,当前有 2 个未关闭 Issue;Star 数为 5.0k,可作为社区活跃度的参考。

简要分析

热度分
5438
价值分
3082
活跃状态
活跃

语言占比

JavaScript
Stylus
TypeScript

Release

README

 

Vegetarian friendly state for React

 

npm MIT License Codecov

v7 Beta — this release modernises Easy Peasy around React 19’s concurrent primitives. The public store/model API is unchanged from v6 and the library is feature-complete, but the v7 line is still in beta — APIs may shift in response to feedback before the stable release. See the v6 → v7 upgrade guide for details, or view the v6 docs for the current stable release.

Easy Peasy is an abstraction of Redux, providing a reimagined API that focuses on developer experience. It allows you to quickly and easily manage your state, whilst leveraging the strong architectural guarantees and extensive eco-system that Redux has to offer.

  • Zero configuration
  • No boilerplate
  • React hooks based API
  • Extensive TypeScript support
  • Encapsulate data fetching
  • Computed properties
  • Reactive actions
  • Redux middleware support
  • State persistence
  • Redux Dev Tools
  • Global, context, or local stores
  • Built-in testing utils
  • React Native supported
  • Hot reloading supported

 

All of this comes via a single dependency install. While v7 is in beta it is published under the beta dist-tag — the latest tag will move to v7 once the stable release ships.

npm install easy-peasy@beta

 

Fly like an eagle 🦅

Create your store

const store = createStore({
  todos: ['Create store', 'Wrap application', 'Use store'],

  addTodo: action((state, payload) => {
    state.todos.push(payload);
  }),
});

Wrap your application

function App() {
  return (
    <StoreProvider store={store}>
      <TodoList />
    </StoreProvider>
  );
}

Use the store

function TodoList() {
  const todos = useStoreState((state) => state.todos);
  const addTodo = useStoreActions((actions) => actions.addTodo);
  return (
    <div>
      {todos.map((todo, idx) => (
        <div key={idx}>{todo}</div>
      ))}
      <AddTodo onAdd={addTodo} />
    </div>
  );
}

 

Examples 📚

See the example folder for more examples of how to use easy-peasy.

 

Core Team 🛠


Peter Weinberg

Jørn A. Myrland

Sean Matheson

 

Our Sponsors ❤️

We have only but great appreciation to those who support this project. If you have the ability to help contribute towards the continued maintenance and evolution of this library then please consider [becoming a sponsor].

 

Documentation

See the official website for tutorials, docs, recipes, and more.

评论

暂无评论