@mediatr/react
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.26 • Public • Published

@mediatr/react

Hooks

core

data

useCommand

import { useCommand } from '@mediatr/react'

export const App() {
  const myCommand = useCommand(MY_COMMAND, 'DEFAULT VALUE')
  
  if (myCommand.loading) {
    return (<p>loading</>)
  }

  return (
    <div>
      <p>{myCommand.data}</p>
      <button onClick={myCommand.handle}>handle</button>
    <div>
  )
}

useHandle

import { useHandle } from '@mediatr/react'

export const App() {
  const myCommand = useHandle(MY_COMMAND, 'PARAMS')
  
  if (myCommand.loading) {
    return (<p>loading</>)
  }

  return (
    <div>
      <p>{myCommand.data}</p>
      <button onClick={myCommand.handle}>handle</button>
    <div>
  )
}

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.0-alpha.670alpha
2.0.0-alpha.260latest

Version History

VersionDownloads (Last 7 Days)Published
2.0.0-alpha.670
2.0.0-alpha.660
2.0.0-alpha.650
2.0.0-alpha.640
2.0.0-alpha.630
2.0.0-alpha.620
2.0.0-alpha.610
2.0.0-alpha.600
2.0.0-alpha.590
2.0.0-alpha.580
2.0.0-alpha.570
2.0.0-alpha.560
2.0.0-alpha.550
2.0.0-alpha.540
2.0.0-alpha.511
2.0.0-alpha.500
2.0.0-alpha.490
2.0.0-alpha.480
2.0.0-alpha.470
2.0.0-alpha.460
2.0.0-alpha.450
2.0.0-alpha.440
2.0.0-alpha.430
2.0.0-alpha.421
2.0.0-alpha.410
2.0.0-alpha.400
2.0.0-alpha.391
2.0.0-alpha.380
2.0.0-alpha.370
2.0.0-alpha.360
2.0.0-alpha.350
2.0.0-alpha.340
2.0.0-alpha.330
2.0.0-alpha.320
2.0.0-alpha.310
2.0.0-alpha.300
2.0.0-alpha.290
2.0.0-alpha.280
2.0.0-alpha.270
2.0.0-alpha.260

Package Sidebar

Install

npm i @mediatr/react

Weekly Downloads

2

Version

2.0.0-alpha.26

License

ISC

Unpacked Size

52.2 kB

Total Files

67

Last publish

Collaborators

  • allangomessl