/**
 * React Native Full App (https://store.enappd.com/product/react-native-full-app)
 *
 * Copyright © 2019-present Enappd. All rights reserved.
 *
 * This source code is licensed as per the terms found in the
 * LICENSE.md file in the root directory of this source tree.
 */
import React from 'react';

const DatabaseContext = React.createContext<any|null>(null);

export const withDatabase = (Component: any) => (props:any) => (
    <DatabaseContext.Consumer>
        {database => <Component {...props} database={database} />}
    </DatabaseContext.Consumer>
)

export default DatabaseContext;
