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

Relax codegen mixin rules #53

Merged
merged 3 commits into from
Jan 21, 2019
Merged

Relax codegen mixin rules #53

merged 3 commits into from
Jan 21, 2019

Conversation

katis
Copy link
Contributor

@katis katis commented Jan 20, 2019

Allows you to write codegen like this (the class Admin = AdminBase with _$Admin syntax still works):

class Admin extends AdminBase with _$Admin {
  Admin(int id) : super(id);
}

abstract class AdminBase extends User implements Store {
  AdminBase(int id) : super(id);

  @observable
  String userName = 'admin';

  @observable
  ObservableList<String> accessRights = ObservableList();
}

Makes you reimplement base class constructor signature, but should work better with json_serializable

@codecov
Copy link

codecov bot commented Jan 20, 2019

Codecov Report

Merging #53 into master will increase coverage by 0.02%.
The diff coverage is 91.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
+ Coverage   96.55%   96.58%   +0.02%     
==========================================
  Files          29       29              
  Lines         784      790       +6     
==========================================
+ Hits          757      763       +6     
  Misses         27       27
Flag Coverage Δ
#example 100% <100%> (ø) ⬆️
#flutter_mobx 100% <ø> (ø) ⬆️
#mobx 96.31% <80%> (-0.01%) ⬇️
#mobx_codegen 97.74% <80%> (-0.02%) ⬇️
Impacted Files Coverage Δ
example/lib/src/generator_example.g.dart 100% <100%> (ø) ⬆️
example/lib/src/generator_example.dart 100% <100%> (ø) ⬆️
mobx_codegen/lib/src/mobx_codegen_base.dart 95.16% <80%> (-0.08%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5f8bbb...4fea224. Read the comment docs.

@katis katis mentioned this pull request Jan 20, 2019
@pavanpodila pavanpodila merged commit 0a52aa5 into master Jan 21, 2019
@pavanpodila pavanpodila deleted the relax_codegen_mixin_rules branch January 21, 2019 08:53
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

Successfully merging this pull request may close these issues.

None yet

2 participants