a4d649f62a
ES6 modules are evaluated only once on first import. They behave like singleton. Some redux librairies except the store to be a singleton. Returning a function and invoking it remove this behavior. Change-Id: I74ff516567d4b7bcf5f1e2d3004eb4617817f117
22 lines
799 B
JavaScript
22 lines
799 B
JavaScript
// Copyright 2018 Red Hat, Inc
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
// not use this file except in compliance with the License. You may obtain
|
|
// a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
// License for the specific language governing permissions and limitations
|
|
// under the License.
|
|
|
|
import { applyMiddleware, createStore } from 'redux'
|
|
import thunk from 'redux-thunk'
|
|
|
|
import appReducers from './reducers'
|
|
|
|
const store = createStore(appReducers, applyMiddleware(thunk))
|
|
|
|
export default store |