Skip to content

Commit

Permalink
docs(yarw): update yarw related README
Browse files Browse the repository at this point in the history
  • Loading branch information
bolasblack committed Aug 5, 2020
1 parent 505c468 commit e2416cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Inspired from [nextools/metarepo](https://github.com/nextools/metarepo)
- [`toolconfs`](packages/toolconfs): Some configuration files for usual tools.
- [`ts-types`](packages/ts-types): Some useful TypeScript type helpers.
- [`start`](packages/start): Some [start](https://github.com/nextools/metarepo/tree/master/packages/start) presets/plugins.
- [`yarw`](packages/yarw): A typesafe, effective redux wrapper.
28 changes: 14 additions & 14 deletions packages/yarw/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# YARW

A redux wrapper inspired by many ideas:
A typesafe, effective redux wrapper. Inspired by many ideas:

- [`docs/为什么要写一个 Redux Wrapper` (chinese)](https://github.com/bolasblack/js-metarepo/blob/master/packages/yarw/docs/why-write-another-redux-wrapper.zh.md)
- [`docs/为什么要写一个 Redux Wrapper` (chinese)](https://github.com/bolasblack/js-metarepo/blob/default/packages/yarw/docs/why-another-redux-wrapper.zh.md)
- https://github.com/Lucifier129/sukkula
- https://mp.weixin.qq.com/s/g4hnfirDmyeuXAdEt-zk9w
- https://redux-toolkit.js.org/
- https://recoiljs.org/

## Feature
## Features

* Type safety
* Never losing type information downstream through all the layers of your application (e.g. no type assertions or hacking with `any` type)
* Less boilerplate code
* Generate action creator/dispatcher automatically
* Code splitting friendly
* Add reducer at any time in your application lifecycle
* Still redux
* So you can still use most of your favorite redux middlewares/tools
- Type safety
- Never losing type information downstream through all the layers of your application (e.g. no type assertions or hacking with `any` type)
- Less boilerplate code
- Generate action creator/dispatcher automatically
- Code splitting friendly
- Add reducer at any time in your application lifecycle
- Still redux
- So you can still use most of your favorite redux middlewares/tools

## Usage

Expand All @@ -40,14 +40,14 @@ setTimeout(() => {

// Action, actionCreator and actionDispatcher has been created automatically
slice.doSomething(100)

// Let's print the count
console.log('current count', slice.getState(root).count)

// You can even unregister slice when you no need, then the reducer will no
// longer work
setTimeout(() => slice.unregister(), Math.randaom() * 1000)
}, Math.random() * 1000)
```

More usage please read [`docs/example.ts`](https://github.com/bolasblack/js-metarepo/blob/master/packages/yarw/docs/example.ts)
More usage please read [`docs/example.ts`](https://github.com/bolasblack/js-metarepo/blob/default/packages/yarw/docs/example.ts)

0 comments on commit e2416cb

Please sign in to comment.