Skip to content
/ worb Public

Reactive container for values that can be observed for changes

License

Notifications You must be signed in to change notification settings

weaze-id/worb

Repository files navigation

worb

worb is a library that provides a reactive container for values that can be observed for changes. It allows you to create "Orb" instances that store values and emit change events whenever the value is updated.

Installation

You can install the worb library using npm:

npm install worb --save

Or using yarn:

yarn add worb

Usage

import { createOrb, useCreateOrb, useOrb } from 'morb';

// Create an Orb instance
const myOrb = createOrb('initial value');

// Use the Orb in a React component
function MyComponent() {
  const [value, setValue] = useOrb(myOrb);

  // ...

  return (
    // JSX rendering using the value and setValue
  );
}

// ...

// Or using hook
function MyComponent() {
  const myOrb = useCreateOrb('initial value');
  const [value, setValue] = useOrb(myOrb);

  // ...

  return (
    // JSX rendering using the value and setValue
  );
}

Contributing

Contributions to worb are welcome! To contribute, please follow the guidelines in CONTRIBUTING.md.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Reactive container for values that can be observed for changes

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published