Last active
August 2, 2019 19:24
-
-
Save cdbattags/48a5a8f3f0a4a27f7e97a03e62d74f2e to your computer and use it in GitHub Desktop.
Revisions
-
cdbattags revised this gist
Aug 2, 2019 . 1 changed file with 0 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,16 +1,3 @@ // or using ES6 arrow functions const middleware = store => next => action => { next(action); -
cdbattags revised this gist
Aug 2, 2019 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ const middleware = function(store){ return function(next){ return function(action){ // some async code action.payload = { data: asyncResponse }; next(action) } } } // or using ES6 arrow functions const middleware = store => next => action => { next(action); }; -
cdbattags revised this gist
Aug 2, 2019 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ import myStore from '../shared/store'; // initial store setup using plain Redux function storeProviderEnhancer() { return () => myStore; } // ... in AngularJS $ngReduxProvider.createStoreWith(state => state, [], [storeProviderEnhancer]); // ... in Angular using angular-redux/store this.ngRedux.provideStore(store as Store<IAppState>); -
cdbattags revised this gist
Aug 2, 2019 . No changes.There are no files selected for viewing
-
cdbattags created this gist
Aug 2, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ import angular from 'angular'; import uiRouter from 'angular-ui-router'; import ngRedux from 'ng-redux'; import AppComponent from './app.component'; import NavigationComponent from './components/navigation/navigation'; import HomeComponent from './containers/home/home'; // import the root reducer from reducers folder import { RootReducer } from './reducers'; // import our default styles for the whole application import 'normalize.css'; import 'bootstrap/dist/css/bootstrap.css'; angular .module('app', [ uiRouter, ngRedux, NavigationComponent.name, HomeComponent.name ]) .config(($locationProvider, $stateProvider, $urlRouterProvider, $ngReduxProvider) => { "ngInject"; // Define our app routing, we will keep our layout inside the app component // The layout route will be abstract and it will hold all of our app views $stateProvider .state('app', { url: '', abstract: true, template: '<app></app>' }) // Dashboard page to contain our goats list page .state('app.home', { url: '/home', template: '<home></home>' }); $urlRouterProvider.otherwise('/home'); // create the root store using ng-redux $ngReduxProvider.createStoreWith(RootReducer); }) .component('app', AppComponent);