Skip to content

Commit

Permalink
fix(use-wire): support initializer function returning undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
smmoosavi committed Nov 6, 2019
1 parent b11a1ea commit 0fc7036
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/api/react-wire.usewire.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ creates and returns a new wire.
```typescript
export declare function useWire<Value>(
upLink: Wire<Value> | null | undefined,
initialValue?: Value | (() => Value),
initialValue?: Value | (() => Value | undefined),
): Wire<Value>;
```

Expand All @@ -20,7 +20,7 @@ export declare function useWire<Value>(
| Parameter | Type | Description |
| ------------ | ----------------------------------------------------------- | ------------------------------------------------------- |
| upLink | <code>Wire&lt;Value&gt; &#124; null &#124; undefined</code> | the up-link wire to be connected to and sync value with |
| initialValue | <code>Value &#124; (() =&gt; Value)</code> | initial value or initializer function |
| initialValue | <code>Value &#124; (() =&gt; Value &#124; undefined)</code> | initial value or initializer function |

<b>Returns:</b>

Expand Down
2 changes: 1 addition & 1 deletion src/use-wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { _WireImpl } from './wire.impl';
*/
export function useWire<Value>(
upLink: Wire<Value> | null | undefined,
initialValue?: Value | (() => Value),
initialValue?: Value | (() => Value | undefined),
): Wire<Value> {
const [wire] = useState(
() =>
Expand Down

0 comments on commit 0fc7036

Please sign in to comment.