Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…ease into patch-1
  • Loading branch information
igorkamyshev committed Sep 12, 2024
2 parents 95171f0 + 26655b7 commit 8d2371d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/website/docs/factories/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ Now we can use `$counter`, `increment`, and `decrement` in our components. Here
::: details Example usage in React

```jsx
import { useUnit } from 'effector-react';
import { $counter, increment, decrement } from './model'; // assuming you've invoked your factory in `model.js`/`model.ts`

const CounterComponent = () => {
const counter = useUnit($counter);
const [onIncrement, onDecrement] = useUnit(increment, decrement);
Expand Down Expand Up @@ -146,8 +149,8 @@ const CounterComponent = () => {
</template>

<script setup>
import { useUnit } from 'effector-vue';
import { $counter, increment, decrement } from './store'; // assuming you've invoked your factory in `store.js`
import { useUnit } from 'effector-vue/composition';
import { $counter, increment, decrement } from './model'; // assuming you've invoked your factory in `model.js`/`model.ts`
const counter = useUnit($counter);
</script>
Expand Down

0 comments on commit 8d2371d

Please sign in to comment.