将数据从Firebase附加到阵列

时间:2018-07-30 20:33:40

标签: swift firebase firebase-realtime-database

我有一些要在tableView中显示的数组:

 shouldRender() {
    return !this.state.isLoading && isFilled && this.state.value
 }

 renderButton = () => {
    if(this.shouldRender()) console.log('button')
 }

 renderResults = () => {
    if(this.shouldRender()) console.log('results')
 }


render() {
        return (
            <div>
                {this.renderResults()}
                {this.renderButton()}
            </div>
        )  
}

我尝试这样获取并附加数据:

private var firOrder = [String]()
private var firDate = [Int]() 

1 个答案:

答案 0 :(得分:1)

由于调用是异步的,因此需要在数据返回的回调内重新加载表

insert into B
select ID from A 
where ID % 2 = 0 and not exists(select 1 from B where ID = A.ID)