反应本机了解容器和存储

我正在开发一个本机应用程序,并且在理解代码的某些部分时遇到了一些问题。特别 容器和商店概念。

如果任何人都可以向我解释这些概念,并且这本代码指南有效,我将不胜感激。

const CONTAINERS = {}

function addContainer(key,klass,...args) {
  CONTAINERS[key] = new klass(...args) // eslint-disable-line
  CONTAINERS[key].containers = CONTAINERS
}

addContainer('auth',AuthContainer)
addContainer('activities',activitiesContainer)

const CONTAINERS_TO_INJECT = Object.keys(CONTAINERS).map(
  (key) => CONTAINERS[key]
)


export default class App extends Component {

  componentDidmount() {
    this.appState = AppState.currentState
    AppState.addEventListener('change',this._handleAppStateChange);
  }

  componentWillUnmount() {
    AppState.removeEventListener('change',this._handleAppStateChange);
  }

  _handleAppStateChange = nextAppState => {
    if (this.appState.match(/inactive|background/) && nextAppState === 'active') {
      this.nowTime = new Date().getTime()
    } else {
      const openTime = (new Date().getTime()-this.nowTime)/1000

};

  state = {
    isAppReady: false,issplashReady: false,}

   _cacheSplashResourcesAsync = async () => {
    const images = [
      require('./assets/images/splash.jpg'),require('./assets/images/logo-IH_blue_gold.png'),]

    return cacheImages(images)
  }


  render() {
    if (!this.state.issplashReady) {
      return (
        <AppLoading
          startAsync={this._cacheSplashResourcesAsync}
          onFinish={() => this.setState({ issplashReady: true })}
          onError={console.warn}
          autoHideSplash
        />
      );
    }
xiangjiale 回答:反应本机了解容器和存储

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3087925.html

大家都在问