Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
onurkerimov committed Nov 10, 2022
1 parent 8f01313 commit 3a3a35d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/advanced-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: advanced-concepts
title: Advanced concepts
---

## Deriving state from external sources (Advanced)
## Deriving state from external sources

With an additional feature of `get` function above, you can get the state from non-atoms. This can be a Redux store, an RxJS observable, or anything that implements getState & subscribe pair. Here is an atom that derives its state from a Redux store.

Expand All @@ -13,7 +13,7 @@ import store from './reduxStore'
const derivedAtom = create((get) => get(store.getState, store.subscribe))
```

## Enhanced atoms (Advanced)
## Enhanced atoms

An enhanced atom is an atom with one or more swapped methods. The most common use case is swapping the default `.set` method of an atom like the following. This technique can be used to create "pass through atoms", that act as a mediators. Most people using **xoid** will not need to write enhanced atoms.

Expand All @@ -29,7 +29,7 @@ $thru.update(s => s + 1) // modifications to `$mediator` will be directly forwar
```
> Swapping `.set` also affects `.update`, because it uses `.set` internally. This is an intentional feature.
## Streams (Advanced)
## Streams

With no arguments used, `create` function produces a special atom called a `Stream`.

Expand Down
2 changes: 1 addition & 1 deletion docs/api-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ id: api-overview
title: API Overview
---

**xoid** consists of 2 exports: `create`, which is used to create atoms, and `use` which is used to get "usables" of an atom if there are any.
**xoid** consists of 2 exports: `create`, which is used to create atoms, and `use` which is used to get "usables" of an atom.

Atoms have the following methods:

Expand Down
2 changes: 1 addition & 1 deletion docs/performance-optimizations.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ console.log($atom.value)
// 25
```

## Lazy evalutation in derived atoms
## Lazy evaluation in derived atoms

A derived atom can be created by using the callback argument of a state initializer function.

Expand Down
3 changes: 0 additions & 3 deletions docs/quick-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ title: Quick Tutorial

> You can skip this part if you've already read the Github README.

## Quick Tutorial

**xoid** has only 2 exports: `create` and `use`. This section will cover them, and the **@xoid/react**.

### Atom
Expand Down

0 comments on commit 3a3a35d

Please sign in to comment.