Code Monkey home page Code Monkey logo

provider_for_redux's People

Contributors

armaaar avatar marcglasberg avatar sgr-ksmt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

provider_for_redux's Issues

Support Provider 4.0.0

Provider 4.0.0 was released recently.

Consider updating this library to support the new provider version.

Reselect like functionality

I like your approach and considering replacing the 'plain vanilla' Redux that I am currently using with your async_redux. I have a fairly complex domain model however that gets assembled by using reselect library selectors. I was wondering if there is a way to achieve the same behaviour (caching and reusing already cached data) with the ReduxSelector?

I know that I could still use the reselect after moving to the async_redux but It would be great to have this provided by the ReduxSelector so I could drop all the ViewModels that are required by the flutter_redux StoreConnector.

Could not find the correct Provider<(ReduxAction<dynamic>, {bool notify}) => void> above this ReduxSelector<AppState, dynamic> Widget

Following is error while using ReduxSelector

Error: Could not find the correct Provider<(ReduxAction, {bool notify}) => void> above this ReduxSelector<AppState, dynamic> Widget

This happens because you used a BuildContext that does not include the provider
of your choice. There are a few common scenarios:

  • You added a new provider in your main.dart and performed a hot-reload.
    To fix, perform a hot-restart.

  • The provider you are trying to read is in a different route.

    Providers are "scoped". So if you insert of provider inside a route, then
    other routes will not be able to access that provider.

  • You used a BuildContext that is an ancestor of the provider you are trying to read.

    Make sure that ReduxSelector<AppState, dynamic> is under your MultiProvider/Provider<(ReduxAction, {bool notify}) => void>.
    This usually happens when you are creating a provider and trying to read it immediately.

    For example, instead of:

    Widget build(BuildContext context) {
      return Provider<Example>(
        create: (_) => Example(),
        // Will throw a ProviderNotFoundError, because `context` is associated
        // to the widget that is the parent of `Provider<Example>`
        child: Text(context.watch<Example>()),
      ),
    }
    

    consider using builder like so:

    Widget build(BuildContext context) {
      return Provider<Example>(
        create: (_) => Example(),
        // we use `builder` to obtain a new `BuildContext` that has access to the provider
        builder: (context) {
          // No longer throws
          return Text(context.watch<Example>()),
        }
      ),
    }
    

Latest version missing in Pub

Would you be able to to push the latest version to the 'Pub' please?
Could you also set the 'async_redux' dependency to the latest version if that works?

Many thanks
Adam

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.