3.0.1 • Published 5 years ago

pri-plugin-dob v3.0.1

Weekly downloads
105
License
-
Repository
-
Last release
5 years ago

pri-plugin-dob · npm version

dob is a tool for monitoring object changes, and dob-react can help you manage stores in react.

We provide a pri-plugin for dob!

Usage

npm i pri-plugin-dob

Features

  • Extend webui for store operates.
  • Allow files in path src/stores/**, and automatic binding stores into entry.

Let's try it! For example, create a store named application:

src/stores/application.tsx

import { Action, inject, observable } from 'dob';

@observable
export class ApplicationStore {
  public testValue = 1;
}

export class ApplicationAction {
  @inject(ApplicationStore) public applicationStore: ApplicationStore;

  @Action
  public test() {
    this.applicationStore.testValue++;
  }
}

pri-plugin-dob will automatic create pri/stores for ts defintion, then you can use it like this:

src/pages/index.tsx

import * as React from 'react';
import { stores } from 'pri/stores';

export default class View extends React.PureComponent<typeof stores, any> {
  render() {
    // this.props.ApplicationStore.testValue
    // this.props.ApplicationAction.test()
  }
}

For more skills about using dob in pri, please see dob docs.

3.0.1

5 years ago

3.0.0

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago