Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

State Framework similar to Fish #52

Open
henry-hz opened this issue Jun 7, 2021 · 2 comments
Open

State Framework similar to Fish #52

henry-hz opened this issue Jun 7, 2021 · 2 comments

Comments

@henry-hz
Copy link

henry-hz commented Jun 7, 2021

Dear @o1298098 ,
I would like to ask you about fish-redux. I feel that their maintenance is very slow, and almost no feedback about the null safety issues posted there.

  • do you think that fish-redux is being abandoned ?
  • what do you think about an idea: to use https://pub.dev/packages/event_bus and manage the state in the same way fish redux is managing, keeping the state, effect, action pattern, but using the bus to send back and forward the communication between the state and view ?
  • what is your opinion about riverpod as a possible candidate to change fish-redux ?

regards
hh

@o1298098
Copy link
Owner

o1298098 commented Jun 19, 2021

Dear @o1298098 ,
I would like to ask you about fish-redux. I feel that their maintenance is very slow, and almost no feedback about the null safety issues posted there.

  • do you think that fish-redux is being abandoned ?

In the past six months, fish-redux has not supported null safety, and it has not been updated for a long time. I think fish-redux should be abandoned.

  • what do you think about an idea: to use https://pub.dev/packages/event_bus and manage the state in the same way fish redux is managing, keeping the state, effect, action pattern, but using the bus to send back and forward the communication between the state and view ?
  • what is your opinion about riverpod as a possible candidate to change fish-redux ?

I prefer to use Mobx combined Provider for state management.

@henry-hz
Copy link
Author

henry-hz commented Aug 2, 2021

@o1298098 I am adapting this approach: https://medium.com/flutter-community/flutter-state-management-for-minimalists-4c71a2f2f0c1 to be used in an almost identical approach used by fish, but.... without any framework, super clean, O(1) performance, only using plain dart. This is my first scratch: https://github.com/insurdao/flutter-boilerplate [still changing to use immutable state]

For the action, only this class is needed:

class Action {
  const Action(this.type, {this.payload});
  final Object type;
  final dynamic payload;
}

this is how the action.dart looks like

import 'package:insurdao/config/base.dart';


enum MainAction { action, loading, tabChanged, jumpToPage, pendingConversations}


loading(bool loading) {
  return Action(MainAction.loading, payload: loading);
}

onTabChanged(int index) {
  return Action(MainAction.tabChanged, payload: index);
}

onJumpToPage(int index) {
  return Action(MainAction.jumpToPage, payload: index);
}

onPendingConversations(int pending) {
  return Action(MainAction.pendingConversations, payload: pending);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants