Skip to content
On this page

Getting started

This library aims to manage the lifecycle, state derivations and mutations of a mutable source. To achieve that we provide 2 main hooks, depending on your use case you can choose one or the other and go through their documentation:

useSourceIf the source initialization have side-effects, like accessing the DOM or a Ref.
usePureSourceIf the source initialization have No side-effects.

Examples

Want to see use-mutable-source in action right away? Look at the examples!

Adding to your Project

Don't forget to add use-mutable-source to your project!

sh
# with npm
npm install use-mutable-source
sh
# with yarn
yarn add use-mutable-source
sh
# with pnpm
pnpm add use-mutable-source

Design philosophy

Once you have read the documentation, if you're curious, you may also read the Design Principles the hooks are based on. This could help you to have a broader view on the API surface area.

Released under the MIT License.