This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
const Pollable = (intervalDurationInSeconds = 60) => { | |
return Component => | |
class extends React.Component { | |
componentDidMount() { | |
this.startPolling() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import Pollable from "@bit/rcdexta.hoc.components.pollable"; | |
class BitcoinTicker extends Component { | |
state = { value: null, lastUpdated: null }; | |
componentDidMount() { | |
this.props.onInterval(this.refresh); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT http://localhost:9200/crm_app | |
{ | |
"settings": { | |
"index": { | |
"analysis": { | |
"filter": {}, | |
"analyzer": { | |
"analyzer_keyword": { | |
"tokenizer": "keyword", | |
"filter": "lowercase" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fullName | shortCode | createdDate | ||
---|---|---|---|---|
Rachel Karen Green | RKG10 | 2018-10-10 | ||
Monica Eustace Geller | MEG52 | 2018-01-12 | ||
Ross Eustace Geller | REG12 | 2018-02-21 | ||
Chandler Muriel Bing | CMB14 | 2018-02-21 | ||
Phoebe Buffay | PBF01 | 2018-04-12 | ||
Joey Francis Tribbiani | JFT99 | 2018-05-15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://localhost:9200/crm_app/customers | |
{ | |
"fullName": "Rachel Karen Green", | |
"shortCode": "RKG10", | |
"createdDate": "2018-10-10" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://localhost:9200/crm_app/customers/_search | |
{ | |
"query": { | |
"match": { | |
"fullName": "geller" | |
} | |
}, | |
"sort": ["_score", {"createdDate": "desc"}] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://localhost:9200/crm_app/customers/_search | |
{ | |
"query": { | |
"match": { | |
"fullName": "geller" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST http://localhost:9200/crm_app/customers/_search | |
{ | |
"query": { | |
"multi_match": { | |
"query": "CMB14", | |
"fields": ["fullName", "shortCode"] | |
} | |
}, | |
"sort": ["_score", {"createdDate": "desc"}] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import ReactDOM from 'react-dom' | |
import Autosuggest from 'react-autosuggest' | |
import axios from 'axios' | |
import { debounce } from 'throttle-debounce' | |
import './styles.css' | |
class AutoComplete extends React.Component { | |
state = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TodoListItem extends React.Component { | |
static propTypes = { | |
item: PropTypes.object, | |
removeItem: PropTypes.func, | |
markTodoDone: PropTypes.func | |
} | |
onClickClose = () => { | |
const {index, removeItem} = this.props; |