hexon-react-z
v1.0.0
Published
React adapter for hexon (DDD-lite core)
Maintainers
Readme
hexon-react-z
React adapter for hexon (DDD-lite core).
Features
- React hook for running use cases
- Loading / error / data state
- No domain logic
- No framework lock-in
Install
npm install hexon-react-z hexonUsage
const activate = useUseCase(
() => new ActivateAccount(repo)
)
await activate.run({ userId: "1" })React is an adapter — hexon stays framework-agnostic.
const activateAccount = useUseCase(() =>
new ActivateAccount(
container.resolve(USER_REPO)
)
)
<button
onClick={() => activateAccount.run({ userId })}
disabled={activateAccount.loading}
>
Activate
</button>License
MIT
