0.5.0 • Published 4 years ago

@loong-js/model v0.5.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

@loong-js/model

This is loong model.

📦 Installation

npm install @loong-js/model

🔨 Usage

import { store } from "@loong-js/model";

class Global {
  @observable
  value = 1;

  @action
  addValue() {
    this.value += 1;
  }
}

@Component()
class Test {
  render() {
    const { global } = store.get();
    return (
      <div>
        value: {global.value}
        <button onClick={global.addValue}>Add</button>
      </div>
    );
  }
}

🐛 Issues

If you find a bug, please file an issue on our issue tracker on GitHub.

🏁 Changelog

Changes are tracked in the CHANGELOG.md.

📄 License

@loong/model is available under the MIT License.

0.5.0

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago