0.0.12 • Published 2 years ago

@e7w/easy-model v0.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

简单模型(easy-model)

一个简单的状态管理包.\ A simple state management lib for Typescript

例子(Example)

import { provide, subscribe } from "@e7w/easy-model";

const A = provide(
  class A {
    msg = "1";

    constructor(private id: number) {}

    random() {
      this.msg = `${Math.random()}`;
    }
  }
);

A(1) === A(1); // true
A(1) !== new A(1); // true
subscribe(A(1), console.log.bind(console, "Path of changed value:"));
const { random } = A(1);
random(); // Path of changed value: ["msg"]
0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.1

2 years ago