action_box 0.0.7 action_box: ^0.0.7 copied to clipboard
This package isolates business logic so that it can be reused.
A library for Dart developers.
Usage #
A simple usage example:
import 'package:action_box/action_box.dart';
//add
import 'example.config.dart';
@ActionBoxConfig(
actionBoxType: 'MyActionBox',
actionRootType: 'ActionRoot',
generateSourceDir: ['*']
)
final actionBox = MyActionBox.instance;
void howToUse() {
//request data
actionBox.dispatch(action: (d) => d.valueConverter.getStringInStringOutValue);
//or
actionBox(
action: (root) => root.valueConverter.getStringInStringOutValue,
param: 'test',
);
//subscribe result
actionBox.subscribe(
action: (d) => d.valueConverter.getStringInStringOutValue,
onNext: (String result) {
print(result);
}
);
}
Features and bugs #
Please file feature requests and bugs at the issue tracker.