Skip to content

Instantly share code, notes, and snippets.

View ramisalem's full-sized avatar
🎯
Focusing

Rami Bamaas ramisalem

🎯
Focusing
View GitHub Profile
@nicubarbaros
nicubarbaros / mentions.js
Created April 17, 2018 21:13
Draft Js Mentions
import { convertFromRaw, convertToRaw, ContentState } from 'draft-js';
const getIndicesOf = (searchStr, str, caseSensitive) => {
let tempStr = str;
let tempSearchStr = searchStr;
const searchStrLen = tempSearchStr.length;
if (searchStrLen === 0) {
return [];
}
let startIndex = 0;