-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Expand file tree
/
Copy pathindex.js
More file actions
48 lines (46 loc) · 994 Bytes
/
index.js
File metadata and controls
48 lines (46 loc) · 994 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/**
* External dependencies
*/
import { uniqueId, take } from 'lodash';
export const fauxEntitySuggestions = [
{
id: uniqueId(),
title: 'Hello Page',
type: 'page',
info: '2 days ago',
url: `?p=${ uniqueId() }`,
},
{
id: uniqueId(),
title: 'Hello Post',
type: 'post',
info: '19 days ago',
url: `?p=${ uniqueId() }`,
},
{
id: uniqueId(),
title: 'Hello Another One',
type: 'page',
info: '19 days ago',
url: `?p=${ uniqueId() }`,
},
{
id: uniqueId(),
title:
'This is another Post with a much longer title just to be really annoying and to try and break the UI',
type: 'post',
info: '1 month ago',
url: `?p=${ uniqueId() }`,
},
];
/* eslint-disable no-unused-vars */
export const fetchFauxEntitySuggestions = (
val = '',
{ isInitialSuggestions } = {}
) => {
const suggestions = isInitialSuggestions
? take( fauxEntitySuggestions, 3 )
: fauxEntitySuggestions;
return Promise.resolve( suggestions );
};
/* eslint-enable no-unused-vars */