-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-indentation also added editor config and eslint
- Loading branch information
Showing
6 changed files
with
164 additions
and
64 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,13 @@ | ||
# This file is for unifying the coding style for different editors and IDEs. | ||
# More information at http://EditorConfig.org | ||
|
||
# No .editorconfig files above the root directory | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
indent_size = 2 |
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,43 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"sourceType": "module", | ||
"ecmaFeatures": { | ||
"jsx": true, | ||
"experimentalObjectRestSpread": true | ||
} | ||
}, | ||
"env": { | ||
"browser": true, | ||
"jasmine": true, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"react/jsx-uses-react": [1], | ||
"camelcase": [0, {"properties": "always"}], | ||
"indent": [2, 2], // 2 spaces indentation | ||
"semi": [2, "always"], | ||
"keyword-spacing": [2], | ||
"space-before-function-paren": [2, "never"], | ||
"space-before-blocks": [2, "always"], | ||
"space-infix-ops": [2, {"int32Hint": false}], | ||
"quotes": [1, "single", "avoid-escape"], | ||
"max-len": [2, 100, 4], | ||
"eqeqeq": [2, "allow-null"], | ||
"strict": 0, | ||
"no-nested-ternary": [2], | ||
"no-underscore-dangle": 0, | ||
"comma-style": [2], | ||
"one-var": [2, "never"], | ||
"brace-style": [2, "1tbs", { "allowSingleLine": true }], | ||
"consistent-this": [0, "self"] | ||
}, | ||
"plugins": [ | ||
"react" | ||
], | ||
"globals": { | ||
"jest": true, | ||
"React": true | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
// a simplified example for handling namespaces and their corresponding changes | ||
const namespaceStore = (initialState = {}) => ({ | ||
namespaces: initialState, | ||
listeners: [], | ||
get(namespace) { | ||
return namespace? this.namespaces[namespace] : this.namespaces | ||
}, | ||
set(namespace, cards) { | ||
this.namespaces[namespace] = cards | ||
this.notify() | ||
}, | ||
subscribe(f) { | ||
this.listeners.push(f) | ||
return () => { | ||
this.listeners = this.listeners.filter(l => { | ||
return l !== f | ||
}) | ||
} | ||
}, | ||
notify() { | ||
this.listeners.map(l => l(this.namespaces)) | ||
namespaces: initialState, | ||
listeners: [], | ||
get(namespace) { | ||
return namespace? this.namespaces[namespace] : this.namespaces | ||
}, | ||
set(namespace, cards) { | ||
this.namespaces[namespace] = cards | ||
this.notify() | ||
}, | ||
subscribe(f) { | ||
this.listeners.push(f) | ||
return () => { | ||
this.listeners = this.listeners.filter(l => { | ||
return l !== f | ||
}) | ||
} | ||
}, | ||
notify() { | ||
this.listeners.map(l => l(this.namespaces)) | ||
} | ||
}) | ||
|
||
export default namespaceStore |