Bloc: wrapping dispatch in a function

Created on 28 Jul 2019  路  3Comments  路  Source: felangel/bloc

I just wonder if wrapping dispatch and events in a function inside the bloc is it a good practice or not?

So instead of using bloc.distpatch(LoginEvent()) I could just use bloc.login()

image

question

Most helpful comment

Hey @amreniouinnovent 馃憢
Thanks for opening an issue!

Regarding your question, it comes down to personal preference. If you like to have helper functions that wrap dispatch that鈥檚 totally fine 馃槃

All 3 comments

I will be interresed to know if it a good practice beacause i do that too.

@MichelMelhem I saw it in Reso Coder channel on youtube

Hey @amreniouinnovent 馃憢
Thanks for opening an issue!

Regarding your question, it comes down to personal preference. If you like to have helper functions that wrap dispatch that鈥檚 totally fine 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wheel1992 picture wheel1992  路  3Comments

nerder picture nerder  路  3Comments

krusek picture krusek  路  3Comments

hivesey picture hivesey  路  3Comments

abinvp picture abinvp  路  3Comments