GithubHelp home page GithubHelp logo

nivisi / controllable Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 288 KB

๐Ÿ›  Easy and convenient state management; Set your business logic apart from the UI level.

Home Page: https://pub.dev/packages/controllable

License: MIT License

Kotlin 0.24% Swift 0.71% Objective-C 0.07% Dart 68.04% TypeScript 30.94%
business-logic dart dart-package dartlang flutter flutter-package library package state state-management

controllable's People

Contributors

nivisi avatar

Watchers

 avatar

controllable's Issues

Allow to gather event params to a single input object

So if we have an event:

abstract class MyEvent implements Event {
  // void we could do this:
  @gatherParams // Probably come up with a better name...
  void nameChanged(String newName, SomeObject details);
}

// In the controller we will get:
@override
void onNameChanged(_OnNameChangedParams params) {
  emitWith(name: params.newName);
}

// And OnNameChangedParams is:
class _OnNameChangedParams {
  _OnNameChangedParams(this.newName, this.details);

  final String newName;
  final SomeObject details
}

Investigate whether we can introduce reusable state helpers

Some states/controller share the similar functionality, for example, lazy loading. Would be nice to make this reusable.

To achieve this, we can probably do the following:

mixin LazyLoadingState on XState {
  bool get isLoading;
}

And our state:

abstract class OurState extends XState with LazyLoadingState {
  /* Any data */
}

Then, in the generator, we could append the data from the mixing to the state so the controller will be able to use it.

The example is very primitive, need to come up with a better one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.