0.0.12 • Published 10 months ago

@e7w/easy-model v0.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months 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

10 months ago

0.0.11

10 months ago

0.0.12

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.1

11 months ago