Skip to content

Commit

Permalink
initial commit, setup testing and wrote out readme a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Chen committed Apr 28, 2017
0 parents commit 0c54e11
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["es2015", "react"],
"plugins": [
"syntax-decorators"
]
}
20 changes: 20 additions & 0 deletions .editorconfig
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
10 changes: 10 additions & 0 deletions .gitignore
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
24 changes: 24 additions & 0 deletions README.markdown
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);
```

38 changes: 38 additions & 0 deletions package.json
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 added src/index.js
Empty file.
5 changes: 5 additions & 0 deletions test/sanity.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('Sanity', () => {
it('should pass', () => {
expect(true).toBe(true);
})
})

0 comments on commit 0c54e11

Please sign in to comment.