How to use the effector-react.useStore function in effector-react

To help you get started, we’ve selected a few effector-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github howtocards / frontend / src / pages / settings / page.js View on Github external
const AvatarSection = () => {
  const avatarUrl = useStore($avatarUrl)

  return (
    
      
        
        
      
    
  )
}
github howtocards / frontend / src / pages / home / page.js View on Github external
export const CardsHomePage = () => {
  const ids = useStore($cardsIds)
  const isLoading = useStore(homeCardsFetching.isLoading)

  React.useEffect(() => {
    pageReady()
  }, [])

  return (
    }>
       <p>What about to create new card?</p>}
      /&gt;
    
  )
}
github howtocards / frontend / src / pages / edit / page.js View on Github external
const Title = () =&gt; {
  const title = useStore($title) || ""
  const titleRef = React.createRef()

  React.useEffect(() =&gt; {
    if (titleRef.current) {
      titleRef.current.focus()
    }
  }, [])

  return (
github howtocards / frontend / src / pages / view / page.js View on Github external
export const CardViewPage = ({ match }: Props) =&gt; {
  const cardId = parseInt(match.params.cardId, 10)

  React.useEffect(() =&gt; {
    cardLoading({ cardId })
  }, [cardId])

  const current = useStore($card)

  return (
    }&gt;
      {current ? (
        
      ) : (
        
      )}
    
  )
}
github howtocards / frontend / src / pages / users / current / page.js View on Github external
export const UserPage = ({ match }: Props) =&gt; {
  const [tab, setTab] = React.useState&lt;"created" | "useful"&gt;("useful")
  const userId = parseInt(match.params.userId, 10)

  const user = useStore($user)
  const { created, useful } = useStore($cards)
  const isLoading = useStore($isLoading)
  const isFailed = useStore($isFailed)
  const error = useStore($error)

  React.useEffect(() =&gt; {
    pageMounted({ userId })
  }, [userId])

  if (isFailed)
    return 

  return (
    }&gt;
       setTab("useful")}&gt;
        Useful
      
      |
github howtocards / frontend / src / pages / join / registration / page.js View on Github external
const RegisterForm = () =&gt; {
  const form = useStore($form)
  const formError = useStore(registerFetching.error)
  const isSubmitEnabled = useStore($isSubmitEnabled)

  return (
    <form>
      
        <h2>Registration to HowToCards</h2>
        {formError &amp;&amp; (
          {mapServerToClientError(formError.error)}
        )}
      
      
      
      
        Create account
      
    
  )</form>
github howtocards / frontend / src / pages / join / registration / page.js View on Github external
const Password = () =&gt; {
  const password = useStore($password)
  const isFormDisabled = useStore($isFormDisabled)
  const passwordError = useStore($passwordError)

  return (
    <input value="{password}" disabled="{isFormDisabled}" label="Password" autocomplete="password" name="password" type="password">
  )
}
github howtocards / frontend / src / pages / home / page.js View on Github external
export const CardsHomePage = () =&gt; {
  const ids = useStore($cardsIds)
  const isLoading = useStore(homeCardsFetching.isLoading)

  React.useEffect(() =&gt; {
    pageReady()
  }, [])

  return (
    }&gt;
       <p>What about to create new card?</p>}
      /&gt;
    
  )
}
github zerobias / effector / website / editor / src / tabs / view.js View on Github external
export const TabsView = () =&gt; {
  const tab = useStore(_tab)
  const flowToggle = useStore(_flowToggle)
  return (
    &lt;&gt;
      
        
          
          
        
        {flowToggle &amp;&amp; }
        
        
        
      
      {tab === 'graphite' &amp;&amp; }
      <div style="{{visibility:"></div>
github howtocards / frontend / src / pages / settings / page.js View on Github external
const ChangeAvatar = () => {
  const [opened, setOpened] = React.useState(false)
  const gravatarEmail = useStore($avaEmail)
  const isDisabled = useStore($isDisabled)
  const isChanged = useStore($avaEmailChanged)

  const isSaveDisabled = isDisabled || !isChanged

  const cancel = React.useCallback(
    (event) => {
      setOpened(false)
      gravatarChangeCancelled(event)
    },
    [setOpened],
  )

  const save = React.useCallback((event) => {
    event.preventDefault()
    gravatarEmailSubmitted(event)
    setOpened(false)
  }, [])