Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.tz(talk.time.start, 'America/Los_Angeles')
.format('dddd');
// create new section and initialize empty array for section index
if (!dataBlob[sID]) {
sectionIDs.push(sID);
rowIDs[sectionIndex] = [];
sectionIndex++;
dataBlob[sID] = sID;
}
rowIDs[rowIDs.length - 1].push(talk.id);
dataBlob[sID + ':' + talk.id] = talk;
});
const ds = new ListView.DataSource({
getSectionData: (dataBlob, sectionID) => dataBlob[sectionID],
getRowData: (dataBlob, sectionID, rowID) =>
dataBlob[sectionID + ':' + rowID],
rowHasChanged: (r1, r2) => r1 !== r2,
sectionHeaderHasChanged: (s1, s2) => s1 !== s2,
});
this.state = {
dataSource: ds.cloneWithRowsAndSections(dataBlob, sectionIDs, rowIDs),
scrollY: new Animated.Value(0),
now: new Date(),
appState: AppState.currentState,
};
if (Platform.OS === 'ios') {
// This isn't relevant on Android.
import TagsGroup from '../weight/tagsGroup'
import request from '../utils/httpUtil'
import Dimen from '../utils/dimensionsUtil'
import api from '../common/api'
import config from '../common/config'
import BookDetail from './bookDetail'
import {
searchHotWords,
refreshHowWord,
searchAutoComplete,
searchBooks,
backToInitState
}from '../actions/searchAction'
var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
class Search extends Component {
constructor(props) {
super(props)
this.state = {
searchWords: '',
searchHistory: []
}
}
componentDidMount() {
const {dispatch} = this.props
// 请求热词,和获取历史搜索数据
let searchW = this.props.searchWord
InteractionManager.runAfterInteractions(()=>{
render() {
const { jokeListState, jokeActions, routingActions, jokeListActions } = this.props;
let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
const jokeListDS = ds.cloneWithRows(jokeListState.joke_list.map((joke) => { return joke._name }));
const addJoke = () => {
jokeActions.setJoke(new Joke());
routingActions.openModal();
};
const editJoke = (id) => {
Joke.get(id).then((joke) => {
jokeActions.setJoke(joke);
routingActions.openModal();
});
};
const renderRow = (rowData, sectionID, rowID, highlightRow) => {
let joke = jokeListState.joke_list[rowID];
constructor (props) {
super(props)
this.state = {
dataSource: new ListView.DataSource({
rowHasChanged: (row1, row2) => row1 !== row2
})
}
}
constructor(props) {
super(props);
//1.设置数据源
let ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
//2.设置返回数据
this.state = {dataSource: ds.cloneWithRows(data)};
}
ScrollView,
Image,
Text,
Modal
} from 'react-native'
import ReadPlatform from '../readPlatform'
import BookDetail from '../bookDetail'
import config from '../../common/config'
import api from '../../common/api'
import Dimen from '../../utils/dimensionsUtil'
import {dateFormat} from '../../utils/formatUtil'
import Toast from '../../weight/toast'
import CommonText from '../../weight/commonText'
var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
export default class Bookshelves extends Component {
constructor(props) {
super(props)
this.state = {
bookshelves: [],
toShow: false,
focusBook: null
}
}
componentDidMount() {
this._getBookshelves()
}
componentWillMount () {
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2})
const devices = this.props.devices.map(function (d) {
const desc = `Use the device named ${d.name} to authorize this installation`
return {
...d,
desc: desc
}
})
if (this.props.hasPGP) {
devices.push({
name: 'PGP Key',
desc: 'Use your PGP key'
})
}
constructor(props: Props) {
super();
const dataSource = new RListView.DataSource({
rowHasChanged: (r1, r2) => r1 !== r2,
});
this.state = {dataSource: dataSource.cloneWithRows(props.items)};
}