-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial commit, setup testing and wrote out readme a bit
- Loading branch information
Thomas Chen
committed
Apr 28, 2017
0 parents
commit 0c54e11
Showing
7 changed files
with
103 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"presets": ["es2015", "react"], | ||
"plugins": [ | ||
"syntax-decorators" | ||
] | ||
} |
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 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.hbs] | ||
insert_final_newline = false | ||
|
||
[*.{diff,md}] | ||
trim_trailing_whitespace = false |
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,10 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
|
||
|
||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
yarn-error.log |
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,24 @@ | ||
# Redux Decorated Reducers | ||
Ever thought about combining the cleaniness of DDAU redux state management with the fine-tuned observable control of MobX (or, if you're in ember-land, computed-properties)? Now you can! | ||
|
||
By declaring metadata on your reducers, you can now subscribe to just changes in the redux store you're interested in. No change to your underlaying data-structure, reopening Object prototype, or any other junk necessary. | ||
|
||
## Usage | ||
Decorate your reducers with metadata regarding what state it reads and what state it updates like so: | ||
|
||
```javascript | ||
const Reducers = { | ||
@reads('posts.post', 'activeUser') | ||
@writes('activePost') | ||
myReducer(state, action) { | ||
/* write your reducer here */ | ||
} | ||
} | ||
``` | ||
|
||
Then, subscribe to just the stuff that changes later on: | ||
|
||
```javascript | ||
this.store.subscribe('activePost', myCallback); | ||
``` | ||
|
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,38 @@ | ||
{ | ||
"name": "redux-decorated-reducers", | ||
"version": "1.0.0", | ||
"description": "redux reducer decorating library for declaring properties and enabling easy integration with the observable pattern", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "jest --notify" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/foxnewsnetwork/redux-decorated-reducers.git" | ||
}, | ||
"keywords": [ | ||
"computed", | ||
"observable", | ||
"declarative", | ||
"properties" | ||
], | ||
"author": "Thomas Chen", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/foxnewsnetwork/redux-decorated-reducers/issues" | ||
}, | ||
"homepage": "https://github.com/foxnewsnetwork/redux-decorated-reducers#readme", | ||
"devDependencies": { | ||
"babel-cli": "^6.24.1", | ||
"babel-core": "^6.24.1", | ||
"babel-jest": "^19.0.0", | ||
"babel-plugin-syntax-decorators": "^6.13.0", | ||
"babel-preset-es2015": "^6.24.1", | ||
"babel-preset-react": "^6.24.1", | ||
"jest": "^19.0.2", | ||
"regenerator-runtime": "^0.10.3" | ||
}, | ||
"jest": { | ||
"testRegex": "(/test/.*\\.spec.js)$" | ||
} | ||
} |
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,5 @@ | ||
describe('Sanity', () => { | ||
it('should pass', () => { | ||
expect(true).toBe(true); | ||
}) | ||
}) |