import { storiesOf } from '@storybook/react'; import React, { FC } from 'react'; import { createGlobalState } from '../src'; import ShowDocs from './util/ShowDocs'; const useGlobalValue = createGlobalState(0); const CompA: FC = () => { const [value, setValue] = useGlobalValue(); return ; }; const CompB: FC = () => { const [value, setValue] = useGlobalValue(); return ; }; const Demo: FC = () => { const [value] = useGlobalValue(); return (

{value}

); }; storiesOf('State/createGlobalState', module) .add('Docs', () => ) .add('Demo', () => );