@@ -93,7 +93,7 @@ Let's see how this all works together ...
9393 npm install --save react-redux
9494 ```
9595 <!-- - WITH REVEAL of USAGE:
96- npm install --save feature-u # VER: >=1 .0.0 USAGE: createAspect(), extendAspectProperty() (v1 replaces App with Fassets obj -AND- publicFace with fassets aspect)
96+ npm install --save feature-u # VER: >=3 .0.0 USAGE: createAspect(), extendAspectProperty() (v1 replaces App with Fassets obj -AND- publicFace with fassets aspect)
9797 npm install --save react # VER: >=0.14.0 USAGE: inject <Provider> component
9898 npm install --save redux # VER: >=3.1.0 USAGE: applyMiddleware(), combineReducers(), compose(), createStore()
9999 npm install --save react-redux # VER: >=1.0.0 USAGE: <Provider> component
@@ -167,19 +167,20 @@ Polyfills](#potential-need-for-polyfills))_.
167167
168168** Well that was easy!!** At this point ** redux** is ** completely setup
169169for your application!** The [ redux store] has been created and is
170- accessible through the standard ** redux** [ ` connect() ` ] function.
170+ accessible through the standard ** redux** [ ` connect() ` ] HoC,
171+ or the newer [ ` Hooks ` ] API.
171172
172173In the nutshell, that's a highlight of most everything you need to know to use
173174** feature-redux** ! _ Go forth and compute!_
174175
175176
176177## A Closer Look
177178
178- ** feature-redux** automatically configures [ redux] by creating the [ store ]
179- _ (accumulating feature [ reducers] across your app)_ , and making the
180- [ store] available through the standard ** redux** [ ` connect() ` ] function,
181- _ (by injecting the standard ** redux ** [ ` <Provider> ` ] component at the root
182- of your app)_ .
179+ ** feature-redux** automatically configures [ redux] by creating the
180+ [ store ] _ (accumulating feature [ reducers] across your app)_ , and
181+ making the [ store] available through the standard ** redux**
182+ [ ` connect() ` ] HoC (or the newer [ ` Hooks ` ] API), _ (by injecting the
183+ standard ** redux ** [ ` <Provider> ` ] component at the root of your app)_ .
183184
184185It is important to understand that your interface to [ redux] has not
185186changed in any way. In other words, you continue to use [ redux] the
@@ -473,6 +474,13 @@ this process (_i.e. the inputs and outputs_) are documented here.
473474 mechanism"). As an example, the [ feature-redux-logic] Aspect
474475 integrates ** redux-logic** .
475476
477+ 3 . ** Enhancer Integration** :
478+
479+ Because ** feature-redux** manages [ redux] , other Aspects can
480+ promote their [ redux enhancer] through ** feature-redux** 's
481+ ` Aspect.getReduxEnhancer() ` API (an "aspect cross-communication
482+ mechanism").
483+
476484
477485### Exposure
478486
@@ -482,16 +490,29 @@ this process (_i.e. the inputs and outputs_) are documented here.
482490 app is by injecting the standard ** redux** [ ` <Provider> ` ] component at
483491 the root of your application DOM. This enables app component
484492 access to the [ redux store] (along with it's ` dispatch() ` and
485- ` getState() ` ) through the standard ** redux** [ ` connect() ` ] function.
493+ ` getState() ` ) through the standard ** redux** [ ` connect() ` ] HoC,
494+ or the newer [ ` Hooks ` ] API.
495+
496+ 2 . ** Application Life Cycle Hooks - namedParams** :
486497
487- 2 . ** Middleware Features** :
498+ ** feature-redux** promotes the redux ` getState ` /` dispatch `
499+ functions as namedParams of ** feature-u** 's [ Application Life Cycle
500+ Hooks] .
501+
502+ 3 . ** Redux Middleware** :
488503
489504 Because ** feature-redux** allows other aspects to inject their
490505 [ redux middleware] , whatever that middleware exposes is made
491506 available. As an example, the [ feature-redux-logic] Aspect
492507 injects ** redux-logic** .
508+
509+ 4 . ** Redux Enhancer** :
510+
511+ Because ** feature-redux** allows other aspects to inject their
512+ [ redux enhancer] , whatever that enhancer exposes is made
513+ available.
493514
494- 3 . ** Other** :
515+ 5 . ** Other** :
495516
496517 - For good measure, ** feature-redux** promotes the [ redux store]
497518 through the ` Aspect.getReduxStore() ` method. This provides direct
@@ -503,34 +524,36 @@ this process (_i.e. the inputs and outputs_) are documented here.
503524
504525### Error Conditions
505526
506- When ** feature-redux** detects that no reducers have been
507- specified by any of your features, it will (by default) throw the
508- following exception:
527+ - ** NO REDUCERS** :
509528
510- ```
511- ***ERROR*** feature-redux found NO reducers within your features
512- ... did you forget to register Feature.reducer aspects in your features?
513- (please refer to the feature-redux docs to see how to override this behavior).
514- ```
529+ When ** feature-redux** detects that no reducers have been
530+ specified by any of your features, it will (by default) throw the
531+ following exception:
515532
516- Most likely this should in fact be considered an error _ (for example
517- you neglected to specify the reducer aspects within your features)_ .
518- ** The reasoning is** : _ why would you not specify any reducers if your
519- using redux?_
533+ ```
534+ ***ERROR*** feature-redux found NO reducers within your features
535+ ... did you forget to register Feature.reducer aspects in your features?
536+ (please refer to the feature-redux docs to see how to override this behavior).
537+ ```
520538
521- You can change this behavior through the following configuration:
539+ Most likely this should in fact be considered an error _ (for example
540+ you neglected to specify the reducer aspects within your features)_ .
541+ ** The reasoning is** : _ why would you not specify any reducers if your
542+ using redux?_
522543
523- ``` js
524- reducerAspect .config .allowNoReducers$ = true ;
525- ```
544+ You can change this behavior through the ` allowNoReducers ` parameter:
545+
546+ ``` js
547+ createReducerAspect ({allowNoReducers: true })
548+ ```
526549
527- With this option enabled, when no reducers are found, redux will be
528- configured with an identity reducer (accompanied with a WARNING
529- logging probe).
550+ - when ` true ` , and no reducers are found, redux will be configured
551+ with an identity reducer (accompanied with a WARNING logging
552+ probe).
530553
531- You can also specify your own reducer function in place of the ` true `
532- value, which will be used ONLY in the scenario where no reducers were
533- specified by your features.
554+ - you can also specify your own app-wide reducer function in place
555+ of the ` true ` value, which will be used ONLY in the scenario where
556+ no reducers were specified by your features.
534557
535558
536559## API
@@ -539,12 +562,37 @@ specified by your features.
539562
540563<ul ><!-- - indentation hack for github - other attempts with style is stripped (be careful with number bullets) --->
541564
542- ` API: createReducerAspect([name='reducer']): reducerAspect `
565+ ```
566+ API: createReducerAspect({name:'reducer',
567+ initialState:undefined,
568+ allowNoReducers:false}): reducerAspect
569+ ```
543570
544571The ` reducerAspect ` is the [ feature-u] plugin that facilitates
545572[ redux] integration to your features.
546573
547- To use this aspect:
574+ ** PARAMS** : _ (** Please Note** : only named parameters are used)_
575+
576+ - ** name** : The name of this reducer (defaults to 'reducer')
577+
578+ - ** initialState** : An optional pre-loaded state that will become the initial
579+ state of your store.
580+
581+ Typically this is not needed, because your reducers will define the
582+ initial state.
583+ However, it can be useful to hydrate the state from the server (in
584+ universal apps), or to restore a previously serialized user session.
585+
586+ When supplied, any validation/errors will be detected by redux, as
587+ it is passed directly to it's ` createStore() ` .
588+
589+ - ** allowNoReducers** : A boolean -or- app-wide reducer function, that
590+ specifies what to do when ** no reducers** are found in any or your
591+ features (defaults to ` false ` which throws an error) ... see: ** NO
592+ REDUCERS** section of [ Error Conditions] ( #error-conditions )
593+
594+
595+ ** USAGE** :
548596
549597- Within your mainline, register the ** feature-redux**
550598 ` reducerAspect ` to ** feature-u** 's [ ` launchApp() ` ] .
@@ -679,21 +727,25 @@ implemented)_ is intended to address this issue.
679727
680728
681729<!-- - redux --->
730+
682731[ redux ] : https://redux.js.org/
683- [ redux store ] : https://redux.js.org/docs/api/Store.html
684- [ store ] : https://redux.js.org/docs/api/Store.html
685- [ redux middleware ] : https://redux.js.org/docs/advanced/Middleware.html
686- [ actions ] : https://redux.js.org/docs/basics/Actions.html
687- [ action creators ] : https://redux.js.org/docs/basics/Actions.html#action-creators
688- [ reducers ] : https://redux.js.org/docs/basics/Reducers.html
689- [ reducer ] : https://redux.js.org/docs/basics/Reducers.html
732+ [ redux store ] : https://redux.js.org/glossary#store
733+ [ store ] : https://redux.js.org/glossary#store
734+ [ redux middleware ] : https://redux.js.org/glossary#middleware
735+ [ redux enhancer ] : https://redux.js.org/glossary#store-enhancer
736+ [ actions ] : https://redux.js.org/glossary#action
737+ [ action creators ] : https://redux.js.org/glossary#action-creator
738+ [ reducers ] : https://redux.js.org/glossary#reducer
739+ [ reducer ] : https://redux.js.org/glossary#reducer
690740[ selectors ] : https://gist.github.com/abhiaiyer91/aaf6e325cf7fc5fd5ebc70192a1fa170
691- [ `connect()` ] : https://github.com/reactjs/react-redux/blob/master/docs/api.md#connectmapstatetoprops-mapdispatchtoprops-mergeprops-options
692- [ `<Provider>` ] : https://github.com/reactjs/react-redux/blob/master/docs/api.md#provider-store
741+ [ `connect()` ] : https://react-redux.js.org/api/connect
742+ [ `Hooks` ] : https://react-redux.js.org/api/hooks
743+ [ `<Provider>` ] : https://react-redux.js.org/api/provider
693744
694745<!-- - redux-logic --->
695746[ redux-logic ] : https://github.com/jeffbski/redux-logic
696747
697748<!-- - 3rd party action managers --->
698749[ action-u ] : https://action-u.js.org/
699750[ redux-actions ] : https://github.com/reduxactions/redux-actions
751+ [ Application Life Cycle Hooks ] : https://feature-u.js.org/cur/appLifeCycle.html
0 commit comments