UNPKG
@cobuildlab/8base-chat
Version:
latest (3.0.6)
3.0.6
3.0.5
3.0.4
3.0.3
3.0.2
3.0.1
3.0.0
2.2.0
2.1.1
2.1.0
2.0.1
2.0.0
1.0.1
1.0.0
Chat component that uses 8base
@cobuildlab/8base-chat
/
src
/
shared
/
utils
/
apollo
/
index.ts
12 lines
(9 loc)
•
238 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
export
function
genOptimisticId
(
) {
return
`optimistic-
${
Math
.round(
Math
.random() *
1000000
)}
`
; }
export
function
isOptimisticId
(
id: any
) {
if
(
typeof
id !==
'string'
) {
return
false
; }
return
id.
startsWith
(
'optimistic'
); }