Provider: HookProvider

Created on 23 Jan 2019  Â·  7Comments  Â·  Source: rrousselGit/provider

Hooks allow some very powerful provider:

HookProvider<MyBloc>(
  value: () {
    final bloc = useMemoized(() => MyBloc());
    useEffect(() => bloc.dipose, [bloc]);
    return bloc;
  },
  child: Container();
);

All 7 comments

I'm watching this.

I'm still hesitating. This would add a new dependency on provider
package. Peoples may not want to download flutter_hooks when using
Provider

On Wed, Jan 23, 2019, 19:16 Jeremiah Ogbomo <[email protected] wrote:

I'm watching this.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/rrousselGit/provider/issues/9#issuecomment-456909629,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ATO0bS2f7ESnzuc8zqlP9mdWK7pytHaCks5vGKcJgaJpZM4aOttx
.

Will do.

This allows to heavily simplify the implementation of other providers (as a StreamProvider is just a useStream hook on a HookProvider)

Which means I can _finally_ continue that hanging PR because I won't have to reimplement the whole world.

I haven't been updating for a while, I completely missed when you removed this.

Do you need it?

I had on an older project that needed revamp but its fine I replaced it with the generic provider. Big ups!

Good! Because I have other plans that are incompatible with HookProvider, and Provider seems to solve all the use-cases anyway. 😄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Alfie-AD picture Alfie-AD  Â·  4Comments

tmxdyf picture tmxdyf  Â·  3Comments

jihongboo picture jihongboo  Â·  4Comments

ykaito21 picture ykaito21  Â·  3Comments

stocksp picture stocksp  Â·  5Comments