React Mug
React Mug 是一个简洁、函数式、贴合 React 组件化机制并拥有完善 Hook 集成的状态管理库。它通过类似马克杯的容器概念来盛装状态,提供简单直观的 API 来管理应用状态。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
React Mug 是一个简洁、函数式、贴合 React 组件化机制并拥有完善 Hook 集成的状态管理库。它通过类似马克杯的容器概念来盛装状态,提供简单直观的 API 来管理应用状态。
• Copy the embed code to showcase this product on your website
• Share on X to spread the word about this amazing tool
0.1.0,用喜欢的包管理器安装就可以使用了,比如我喜欢直接用 npm:shnpm i react-mug下面我用一个 “加鱼” 的简单例子带大家快速感受一下。首先声明一个盛装 “鱼的数量” 状态的 Mug。所谓 Mug,就是马克杯的那个马克,而状态就是马克杯里的咖啡,声明一个 Mug 就拥有了一个盛装某个状态的容器,这里的状态便是 “鱼的数量”,[construction] 字段既表示了当前对象是一个 Mug 也设置了当前 Mug 里状态的初始值:tsximport { Mug, construction } from 'react-mug';const fishesMug: Mug<number> = { [construction]: 10,};然后创建一个 “加鱼” 的写操作器。加鱼顾名思义就是增加一条鱼 🐟:tsximport { w } from 'react-mug';const increment = w((n: number) => n + 1);之后分别创建 “展示鱼的数量” 和 “操控鱼的数量” 的两个 React 组件:tsximport { check, useOperator } from 'react-mug';function Fishes() { const fishes = useOperator(check, fishesMug); return <div>鱼的数量:{fishes}</div>;}function Controls() { return <button onClick={() => increment(fishesMug)}>加鱼</button>;}最后渲染这两个组件就可以在点击 “加鱼” 按钮的时候让 “鱼的数量” 加 1 了,除了以上代码不需要进行任何额外的配置。...A code-free online store builder to turn views into revenue. Sell digital products, subscriptions, and merch, without fees or hassle.
Convert videos into awesome blog posts.
Fast Image AI instantly transforms your photos into stunning styles like Ghibli, Sketch, and Pixar. Effortlessly control image elements and create amazing effects with just one click.
AI-powered tool that transforms casual photos into professional LinkedIn headshots instantly. No photographer needed—just upload and download.
Crevas unifies Veo 3, Sora 2, Nano Banana and more into one intuitive canvas — so filmmakers can script, prompt, and generate cinematic stories without switching tools or losing consistency.
AI Foto Edit - Text to Image & Image Edit