File size: 500 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# User store

This store includes behavior for checking if a user is logged in, and fetching info about the current user.

## Usage

Register the user store:

```js
import { User } from '@automattic/data-stores';

const USER_STORE = User.register();
```

### Current user

Check if a current user is logged in:

```js
import { useSelect } from '@wordpress/data';

function MyComponent() {
	const isLoggedIn = useSelect( ( select ) => select( USER_STORE ).isCurrentUserLoggedIn() );
	// …snip
}
```