'use strict';

const React = require('react');

const useStore = (store, callback) => {
  const result = store(callback);
  const [data, setData] = React.useState();
  React.useEffect(() => {
    setData(result);
  }, [result]);
  return data;
};

exports.useStore = useStore;
