Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dob

> 前端框架
Open source

Light and fast state management tool using proxy.

728 stars0 likes1 views
WebsiteGitHub

About

Light and fast state management tool using proxy.

Dob

        Dob is a tool for monitoring object changes. Using Proxy. Online Docs.

Examples

There are some demo on fiddle. Here's the simplest:

typescript
import { observable, observe } from "dob";

const obj = observable({ a: 1 });

observe(() => {
  console.log("obj.a has changed to", obj.a);
}); //  Use `inject` to pick stores in action, do not `new UserStore()`, it's terrible for later maintenance.

## Use in react project

```typescript
import { Action, observable, combineStores, inject } from "dob";
import { Provider, Connect } from "dob-react";

@observable
export class UserStore {
  name = "bob";
}

export class UserAction {
  @inject(UserStore) userStore: UserStore;

  @Action
  setName() {
    this.userStore.name = "lucy";
  }
}

@Connect
class App extends React.Component {
  render() {
    return (
      
        {this.props.UserStore.name}
      
    );
  }
}

ReactDOM.render(
  
    
  ,
  document.getElementById("react-dom")
);

…

typescript
class A {
  @inject(B) b;
}
class B {
  @inject(A) a;
}

Do not deconstruct to the last level on dynamic object

typescript
const obj = observable({ a: 1 });

// good
obj.a = 5;
// bad
let { a } = obj;
a = 5;

Inspired

  • mobx
  • nx-js

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptdobdynamicdynamic-objectobservable

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category前端框架
PricingOpen source

> Related tools

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