obx 0.1.3 copy "obx: ^0.1.3" to clipboard
obx: ^0.1.3 copied to clipboard

obx is a elegant state management library.

Obx - Elegant state management library #

Obx is elegant from the name to the way it is used. Its description only needs two screenshots

Feture #

  • Obx not need Provider at root Widget.
  • Obx use memo to intercept update, like react.Hooks.
  • Obx is tiny and ease use, only 2 API: ob, next

Install Obx #

Change pubspec.yaml:

dependencies:
  obx:

Overall interpretation #

Instance a user,extends Obx:

// Definition Obx
class User extends Obx {
  String name = "dog";
}

// Instance, use some widgets
var user = User();

Subscribe and return a weight:

user.ob(()=>Text(user.name))

Submit and update user.ob's subscribe:

user.next()

Better performance #

Use memo options params, like React.useMemo, only rerender data in memo array.

Example only rerender when user.name change:

user.ob(
  () => Text(user.name), 
  memo: ()=>[user.name],
);

Thanks #

That all, keep sample :)

2
likes
120
pub points
43%
popularity

Publisher

unverified uploader

obx is a elegant state management library.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on obx