Skip to content

Commit d69ae58

Browse files
authored
Merge pull request #9 from space307/useSlot
Use slot
2 parents 4b9de04 + 8046408 commit d69ae58

6 files changed

Lines changed: 152 additions & 153 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Change Log
2+
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## 1.1.0
6+
7+
- Feat: returns `Slot` component from `createSlot` fn.
8+
- Deprecated: `$slot`. Looks useless
9+
10+
# 1.0.0
11+
12+
- Hello, World!

README.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,7 @@ import { useStoreMap } from 'effector-react';
5252

5353
import { createSlot, SLOTS } from './slots';
5454

55-
const { $slot } = createSlot({ id: SLOTS.FOO });
56-
57-
export const FooSlot = () => {
58-
const Component = useStoreMap({
59-
store: $slot,
60-
fn: ({ component }) => component,
61-
keys: [],
62-
});
63-
64-
return <Component />;
65-
};
55+
export const { Slot: FooSlot } = createSlot({ id: SLOTS.FOO });
6656
```
6757

6858
### Step 4
@@ -127,10 +117,10 @@ const { createSlot, api } = createSlotFactory({ slots: { FOO: 'foo' } });
127117

128118
### createSlot
129119

130-
Function, takes the slot id. Returns the store containing the slot.
120+
Function, takes the slot id. Returns Slot component.
131121

132122
```typescript
133-
const { $slot } = createSlot({ id: 'foo' });
123+
const { Slot } = createSlot({ id: 'foo' });
134124
```
135125

136126
### api.set

0 commit comments

Comments
 (0)