Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
style: change prettier config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad Hasani committed Oct 19, 2020
1 parent d371351 commit 6a5f95b
Show file tree
Hide file tree
Showing 76 changed files with 24,699 additions and 25,135 deletions.
8 changes: 5 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"singleQuote": true,
"arrowParens": "avoid",
"semi": false,
"printWidth": 80,
"trailingComma": "es5"
"singleQuote": true,
"trailingComma": "all",
"printWidth": 144,
"tabWidth": 4
}
118 changes: 44 additions & 74 deletions CHANGELOG.md

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Expand Down
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ Following these guidelines helps to communicate that you respect the time of the
**What kinds of contributions we are looking for ?**
Deox is an open source project and we love to receive contributions from our community — you! There are many ways to contribute:

- **Q/A**: file bug reports, the more details you can give the better (i.e. REPL-links or repos that demonstrate the specific issue)
- **Marketing**: writing blog posts, howto's, printing stickers, ...
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
- **Code**: take a look at the open issues. Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.
- **Q/A**: file bug reports, the more details you can give the better (i.e. REPL-links or repos that demonstrate the specific issue)
- **Marketing**: writing blog posts, howto's, printing stickers, ...
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, ...
- **Code**: take a look at the open issues. Even if you can't write code, commenting on them, showing that you care about a given issue matters. It helps us triage them.

## Your First Contribution

Expand All @@ -32,13 +32,13 @@ At this point, you're ready to make your changes! Feel free to ask for help; **e
2. Git clone the [Deox repository](https://github.com/thebordmann/deox).
3. from the root of repository run following command to install dependencies required for development:

```bash
# YARN
yarn
```bash
# YARN
yarn

# NPM
npm install
```
# NPM
npm install
```

4. Do the change in the repository.
5. If you like the change and think the project could use it, make a pull request.
Expand Down
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ Behold, the art of Deox:

## Highlights

- **Minimalist** (almost no import cost) - checkout [Bundle Phobia](https://bundlephobia.com/result?p=deox@latest).
- **Simple** - focused on self-declarative API.
- **Secure** - complete test-suits for all of the edge and corners.
- **Minimalist** (almost no import cost) - checkout [Bundle Phobia](https://bundlephobia.com/result?p=deox@latest).
- **Simple** - focused on self-declarative API.
- **Secure** - complete test-suits for all of the edge and corners.

## Motivation

Expand Down Expand Up @@ -84,16 +84,14 @@ import { createActionCreator, createReducer } from 'deox'

const increment = createActionCreator('INCREMENT')
const decrement = createActionCreator('DECREMENT')
const reset = createActionCreator('RESET', resolve => (count: number) =>
resolve(count)
)
const reset = createActionCreator('RESET', resolve => (count: number) => resolve(count))

const defaultState = 0

const counterReducer = createReducer(defaultState, handleAction => [
handleAction(increment, state => state + 1),
handleAction(decrement, state => state - 1),
handleAction(reset, (_state, { payload }) => payload),
handleAction(increment, state => state + 1),
handleAction(decrement, state => state - 1),
handleAction(reset, (_state, { payload }) => payload),
])

counterReducer(undefined, increment()) //=> 1
Expand All @@ -103,13 +101,13 @@ counterReducer(3, reset(0)) //=> 0

## Documentation

- [Introduction](https://deox.js.org)
- [Getting started](https://deox.js.org/getting-started)
- [API reference](https://deox.js.org/api-reference)
- [FAQ](https://deox.js.org/api-reference)
- [Using redux-thunk with Deox](https://deox.js.org/faq#using-redux-thunk-with-deox)
- [Using redux-saga with Deox](https://deox.js.org/faq#using-redux-saga-with-deox)
- [Using redux-observable with Deox](https://deox.js.org/faq#using-redux-observable-with-deox)
- [Introduction](https://deox.js.org)
- [Getting started](https://deox.js.org/getting-started)
- [API reference](https://deox.js.org/api-reference)
- [FAQ](https://deox.js.org/api-reference)
- [Using redux-thunk with Deox](https://deox.js.org/faq#using-redux-thunk-with-deox)
- [Using redux-saga with Deox](https://deox.js.org/faq#using-redux-saga-with-deox)
- [Using redux-observable with Deox](https://deox.js.org/faq#using-redux-observable-with-deox)

## FAQ

Expand Down Expand Up @@ -171,8 +169,8 @@ Please read through our [contributing guidelines](CONTRIBUTING.md).

## Inspiration

- [redux-actions](https://github.com/redux-utilities/redux-actions) - Flux Standard Action utilities for Redux
- [typesafe-actions](https://github.com/piotrwitek/typesafe-actions) - Typesafe Action Creators for Redux / Flux Architectures (in TypeScript)
- [redux-actions](https://github.com/redux-utilities/redux-actions) - Flux Standard Action utilities for Redux
- [typesafe-actions](https://github.com/piotrwitek/typesafe-actions) - Typesafe Action Creators for Redux / Flux Architectures (in TypeScript)

## License

Expand Down
52 changes: 11 additions & 41 deletions docs/api-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ completeAllTodos() //=> { type: 'COMPLETE_ALL_TODOS' }
```ts
import { createActionCreator } from 'deox'

const addTodo = createActionCreator('ADD_TODO', resolve => (text: string) =>
resolve(text)
)
const addTodo = createActionCreator('ADD_TODO', resolve => (text: string) => resolve(text))
addTodo('Read the docs') //=> { type: 'ADD_TODO', payload: 'Read the docs' }
```

Expand All @@ -45,10 +43,7 @@ addTodo('Read the docs') //=> { type: 'ADD_TODO', payload: 'Read the docs' }
```ts
import { createActionCreator } from 'deox'

const showTodos = createActionCreator(
'SHOW_TODOS',
resolve => (param: number) => resolve(undefined, param)
)
const showTodos = createActionCreator('SHOW_TODOS', resolve => (param: number) => resolve(undefined, param))
showTodos(10) //=> { type: 'ADD_TODO', meta: 10 }
```

Expand All @@ -57,10 +52,7 @@ showTodos(10) //=> { type: 'ADD_TODO', meta: 10 }
```ts
import { createActionCreator } from 'deox'

const getTodo = createActionCreator(
'GET_TODO',
resolve => (id: number, meta: string) => resolve(id, meta)
)
const getTodo = createActionCreator('GET_TODO', resolve => (id: number, meta: string) => resolve(id, meta))
getTodo(700, 'some-meta') //=> { type: 'GET_TODO', payload: 700, meta: 'some-meta' }
```

Expand Down Expand Up @@ -90,16 +82,14 @@ import { createActionCreator, createReducer } from 'deox'

const increment = createActionCreator('INCREMENT')
const decrement = createActionCreator('DECREMENT')
const reset = createActionCreator('reset', resolve => (count: number) =>
resolve(count)
)
const reset = createActionCreator('reset', resolve => (count: number) => resolve(count))

const defaultState = 0

const counterReducer = createReducer(defaultState, handleAction => [
handleAction(increment, state => state + 1),
handleAction(decrement, state => state - 1),
handleAction(reset, (_, { payload }) => payload),
handleAction(increment, state => state + 1),
handleAction(decrement, state => state - 1),
handleAction(reset, (_, { payload }) => payload),
])
```

Expand Down Expand Up @@ -163,12 +153,7 @@ import { delay, mapTo } from 'rxjs/operators'

const ping = createActionCreator('PING')

const pingEpic = action$ =>
action$.pipe(
ofType(ping),
delay(1000),
mapTo({ type: 'PONG' })
)
const pingEpic = action$ => action$.pipe(ofType(ping), delay(1000), mapTo({ type: 'PONG' }))
```

#### With multiple action creators:
Expand All @@ -180,12 +165,7 @@ import { delay, mapTo } from 'rxjs/operators'
const ping = createActionCreator('PING')
const pong = createActionCreator('PONG')

const pingPongEpic = action$ =>
action$.pipe(
ofType([ping, pong]),
delay(1000),
mapTo({ type: 'DONE' })
)
const pingPongEpic = action$ => action$.pipe(ofType([ping, pong]), delay(1000), mapTo({ type: 'DONE' }))
```

#### With action:
Expand All @@ -194,12 +174,7 @@ const pingPongEpic = action$ =>
import { createActionCreator, ofType } from 'deox'
import { delay, mapTo } from 'rxjs/operators'

const pingEpic = action$ =>
action$.pipe(
ofType({ type: 'PING' }),
delay(1000),
mapTo({ type: 'PONG' })
)
const pingEpic = action$ => action$.pipe(ofType({ type: 'PING' }), delay(1000), mapTo({ type: 'PONG' }))
```

#### With action type:
Expand All @@ -208,12 +183,7 @@ const pingEpic = action$ =>
import { createActionCreator, ofType } from 'deox'
import { delay, mapTo } from 'rxjs/operators'

const pingEpic = action$ =>
action$.pipe(
ofType('PING'),
delay(1000),
mapTo({ type: 'PONG' })
)
const pingEpic = action$ => action$.pipe(ofType('PING'), delay(1000), mapTo({ type: 'PONG' }))
```

## _Action<Type, Payload, Meta>_
Expand Down
60 changes: 30 additions & 30 deletions docs/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ route: /faq
The following codesandbox is a working example of using Redux Thunk middleware with Deox.

<iframe
src="https://codesandbox.io/embed/40nlpqq3px?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Fstore%2Ftodos.ts&view=editor"
title="redux-thunk-example"
style={{
width: '100%',
height: '800px',
border: 0,
borderRadius: '4px',
overflow: 'hidden',
}}
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
src="https://codesandbox.io/embed/40nlpqq3px?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Fstore%2Ftodos.ts&view=editor"
title="redux-thunk-example"
style={{
width: '100%',
height: '800px',
border: 0,
borderRadius: '4px',
overflow: 'hidden',
}}
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
/>

## Using redux-saga with Deox
Expand All @@ -35,16 +35,16 @@ easy to test,
and better at handling failures.

<iframe
src="https://codesandbox.io/embed/o4j94qnp2y?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Fstore%2Ftodos.ts&view=editor"
title="redux-saga-example"
style={{
width: '100%',
height: '800px',
border: 0,
borderRadius: '4px',
overflow: 'hidden',
}}
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
src="https://codesandbox.io/embed/o4j94qnp2y?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Fstore%2Ftodos.ts&view=editor"
title="redux-saga-example"
style={{
width: '100%',
height: '800px',
border: 0,
borderRadius: '4px',
overflow: 'hidden',
}}
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
/>

## Using redux-observable with Deox
Expand All @@ -56,14 +56,14 @@ Deox exports a RxJS operator named [`ofType`](/api-reference#oftypekeys) which c
The following codesandbox is a working example of using Redux Observable middleware with Deox.

<iframe
src="https://codesandbox.io/embed/reduxobservableexample-z6sdk?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Fstore%2Ftodos.ts&view=editor"
title="redux-observable-example"
style={{
width: '100%',
height: '800px',
border: 0,
borderRadius: '4px',
overflow: 'hidden',
}}
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
src="https://codesandbox.io/embed/reduxobservableexample-z6sdk?autoresize=1&fontsize=14&hidenavigation=1&module=%2Fsrc%2Fstore%2Ftodos.ts&view=editor"
title="redux-observable-example"
style={{
width: '100%',
height: '800px',
border: 0,
borderRadius: '4px',
overflow: 'hidden',
}}
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
/>
16 changes: 7 additions & 9 deletions docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ You can see all of these utilities at API reference page.

The most important utility functions that Deox provides are:

- [`createActionCreator`](/api-reference#createactioncreatortype-executor): creates an **action creator** by given action type (AKA [`createAction`](/api-reference#createactiontype-executor))
- [`createReducer`](/api-reference#createreducerdefaultstate-handlermapscreator): creates a **reducer** by given default state and an array of action handlers
- [`createActionCreator`](/api-reference#createactioncreatortype-executor): creates an **action creator** by given action type (AKA [`createAction`](/api-reference#createactiontype-executor))
- [`createReducer`](/api-reference#createreducerdefaultstate-handlermapscreator): creates a **reducer** by given default state and an array of action handlers

Let's see the famous simple counter example:

Expand All @@ -64,16 +64,14 @@ import { createActionCreator, createReducer } from 'deox'

const increment = createActionCreator('INCREMENT')
const decrement = createActionCreator('DECREMENT')
const reset = createActionCreator('RESET', resolve => (count: number) =>
resolve(count)
)
const reset = createActionCreator('RESET', resolve => (count: number) => resolve(count))

const defaultState = 0

const counterReducer = createReducer(defaultState, handleAction => [
handleAction(increment, state => state + 1),
handleAction(decrement, state => state - 1),
handleAction(reset, (_state, { payload }) => payload),
handleAction(increment, state => state + 1),
handleAction(decrement, state => state - 1),
handleAction(reset, (_state, { payload }) => payload),
])

counterReducer(undefined, increment()) //=> 1
Expand All @@ -89,7 +87,7 @@ How? It's Magic!

The [Deox repository](https://github.com/thebrodmann/deox) contains several example demonstrating various aspects of how to use Deox.

- **Tasks**: [Source](https://github.com/thebrodmann/deox/tree/master/examples/tasks)
- **Tasks**: [Source](https://github.com/thebrodmann/deox/tree/master/examples/tasks)

## Help and Discussion

Expand Down
8 changes: 4 additions & 4 deletions docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ So, this is where Deox takes place to **make maintenance of Flux architecture si

## Highlights

- **Minimalist** (almost no import cost) - checkout [Bundle Phobia](https://bundlephobia.com/result?p=deox@latest).
- **Simple** - focused on self-declarative API.
- **Secure** - complete test-suits for all of the edge and corners.
- **Actively maintained** - monitoring issues and respond in a timely manner.
- **Minimalist** (almost no import cost) - checkout [Bundle Phobia](https://bundlephobia.com/result?p=deox@latest).
- **Simple** - focused on self-declarative API.
- **Secure** - complete test-suits for all of the edge and corners.
- **Actively maintained** - monitoring issues and respond in a timely manner.

Now you know the motivation behind the Deox. Let's [**get started**](/getting-started)!
Loading

0 comments on commit 6a5f95b

Please sign in to comment.