-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d15b335
commit 80a5efb
Showing
27 changed files
with
390 additions
and
116 deletions.
There are no files selected for viewing
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# `nger-module-core` | ||
|
||
> 全段页面核心 |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
'use strict'; | ||
|
||
const ngerModuleCore = require('..'); | ||
|
||
describe('nger-module-core', () => { | ||
it('needs tests'); | ||
}); |
Empty file.
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "nger-module-core", | ||
"version": "0.0.1", | ||
"description": "> TODO: description", | ||
"author": "imeepos <1037483576@qq.com>", | ||
"homepage": "https://github.com/meepobrother/nger#readme", | ||
"license": "ISC", | ||
"main": "lib/nger-module-core.js", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"publishConfig": { | ||
"registry": "http://registry.npmjs.org/" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/meepobrother/nger.git" | ||
}, | ||
"scripts": { | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/meepobrother/nger/issues" | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/nger-module-webpack/lib/providers/store/webpack.actions.ts
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Action } from 'nger-store'; | ||
|
||
export enum WebpackActionTypes { | ||
// 打包命令 | ||
Build = '[Webpack Build] Build', | ||
Decrement = '[Counter Component] Decrement', | ||
Reset = '[Counter Component] Reset', | ||
} | ||
|
||
// 打包 | ||
export class Build implements Action { | ||
readonly type = WebpackActionTypes.Build; | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/nger-module-webpack/lib/providers/store/webpack.effects.ts
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Injectable } from 'nger-core'; | ||
import { Actions, Effect, ofType } from 'nger-effects'; | ||
import { EMPTY, Observable, of } from 'rxjs'; | ||
import { map, mergeMap, catchError } from 'rxjs/operators'; | ||
import { WebpackActionTypes } from './webpack.actions' | ||
@Injectable() | ||
export class WebpackEffects { | ||
@Effect() | ||
loadMovies$ = this.actions$ | ||
.pipe( | ||
ofType(WebpackActionTypes.Increment), | ||
mergeMap(() => { | ||
console.log(`Increment`) | ||
return of({ type: WebpackActionTypes.Reset }); | ||
}) | ||
); | ||
|
||
constructor( | ||
private actions$: Actions, | ||
) { | ||
this.actions$.subscribe(res => { | ||
console.log(`action`, res) | ||
}); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
packages/nger-module-webpack/lib/providers/store/webpack.reducer.ts
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Action } from 'nger-store'; | ||
import { WebpackActionTypes } from './webpack.actions'; | ||
|
||
export const initialState = 0; | ||
|
||
export function counterReducer(state = initialState, action: Action) { | ||
switch (action.type) { | ||
case WebpackActionTypes.Increment: | ||
return state + 1; | ||
|
||
case WebpackActionTypes.Decrement: | ||
return state - 1; | ||
|
||
case WebpackActionTypes.Reset: | ||
return 0; | ||
|
||
default: | ||
return state; | ||
} | ||
} |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Oops, something went wrong.