Permalink
Browse files

whoops!

  • Loading branch information...
developit committed Dec 6, 2017
1 parent cab9e0e commit 085b7a962190429d7936e9d30d2f41b48637b209
Showing with 39 additions and 3 deletions.
  1. +0 −1 .gitignore
  2. +38 −0 README.md
  3. +1 −2 package.json
View
@@ -1,5 +1,4 @@
node_modules
npm-debug.log
dist
README.md
package-lock.json
View
@@ -0,0 +1,38 @@
# unistore
A tiny store + connect implementation for [Preact].
### Usage
```js
import { Provider, createStore, connect } from 'unistore'
let store = createStore({ count: 0 })
let actions = store => ({
increment() {
store.setState({ count: store.getState().count+1 })
}
})
const App = connect('counter', actions)(
({ count, increment }) => (
<div>
<p>Count: {count}</p>
<button onClick={increment}>Increment</button>
</div>
)
)
export default () => (
<Provider store={store}>
<App />
</Provider>
)
```
### License
MIT
[Preact]: https://github.com/developit/preact
View
@@ -10,8 +10,7 @@
"build": "npm run transpile && npm run size",
"transpile": "rollup -c --environment FORMAT:umd && rollup -c --environment FORMAT:cjs && rollup -c --environment FORMAT:es",
"size": "strip-json-comments --no-whitespace dist/unistore.js | gzip-size",
"test": "eslint unistore.js && jest",
"prepublish": "npm run build && cp \"*unistore.md\" README.md"
"test": "eslint unistore.js && jest"
},
"eslintConfig": {
"extends": "eslint-config-synacor",

0 comments on commit 085b7a9

Please sign in to comment.