open-index/open-npm huggingface dataset:
npm package: @principledcodes/promise-xray
Description: Getting insights of promise chain processing
Author: Anton Klimenko
Latest version: 2.0.5

# promise-xray
Getting insights of promise chain processing.

## Usage

### all()
Builds an observable collection of promises and resolves it with Promise.all(). The observable collection resolved to the collection of the same type as the initial promises collection would resolve.

### allSettled()
Builds an observable collection of promises and resolves it with Promise.allSettled(). The observable collection resolved to the collection of the same type as the initial promises collection would resolve.

### isRejected
Type predicate to identify rejected PromiseSettledResult

### isResolved
Type predicate to identify resolved PromiseSettledResult

### observe()
Calls observer after promise fulfilled and propagates promise result.

### observables()
Builds an observable collection of promises. The collection resolves to the same results as the initial promises collection would resolve.

## Contributing
npm package: @principlestudios/cra-template-lib
Description: The base template for Create React App.
Latest version: 1.1.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @principlestudios/cra-template-lib

Use this template with:

    npx create-react-app <app-name> --scripts-version @principlestudios/react-scripts-lib --template @principlestudios/lib
npm package: @principlestudios/cra-template-typescript-lib
Description: The base TypeScript template for Create React App.
Latest version: 1.1.2
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @principlestudios/cra-template-typescript-lib

Use this template with:

    npx create-react-app <app-name> --scripts-version @principlestudios/react-scripts-lib --template @principlestudios/typescript-lib
npm package: @principlestudios/jotai-animation-atom
Description: 👻 Jotai animation utilities
Author: Matt DeKrey
Latest version: 0.4.0

# Animation for Jotai Atoms

This provides a simple way to bind Jotai atoms to real-time animations.

Please note that the current state of this package is a proof-of-concept; while it works quite well, there is no live demo and the API may change significantly.

Included in this package:

- Utilities for animation
  - `getAnimationSignal` - given a `get` from a store, will subscribe to animation updates when used within Jotai's `atom()` and return the current performance timer value
  - `getInstantaneousAnimationSignal` - returns the current performance timer value
  - `manuallyUpdateAnimationFrame` - function to manually trigger animationSignal updates when not subscribed (this prety well defeats the purpose of animations...)
  - `tweenedAtom` - tweens an `Atom<number>` via an `EasingFunction` (not provided, but see [tween.js](https://www.npmjs.com/package/@tweenjs/tween.js)'s `Easing` export for examples) using the `animationSignal`
  - `initializeForAnimations` - initializes a store for animations. Happens automatically if a `tweenedAtom` or an animation using `getAnimationSignal` is subscribed to.

Usage example:

```tsx
import { atom } from 'jotai';
import {
	tweenedAtom,
	getAnimationSignal,
} from '@principlestudios/jotai-animation-atom';

const size = atom(15);
const tweenedSize = tweenedAtom(size, Easing.Quadratic.Out);
const customAtom = atom(
	(get) => Math.round(getAnimationSignal(get) / 1000) % 2
);
```

## Troubleshooting

If your animations are not happening and you are not using subscriptions, make sure you call `initializeForAnimations(store)` with the store you are using to get the animation values.
npm package: @principlestudios/jotai-react-signals
Description: 👻 React signals using Jotai
Author: Matt DeKrey
Latest version: 0.6.0

# React Signals with Jotai

This provides a simple way to bind Jotai atoms to React intrinsic elements to get reactive pages, like the signals paradigm, in order to reduce React rerenders.

Please note that the current state of this package is a proof-of-concept; while it works quite well, there is no live demo and the API may change significantly.

Included in this package:

- Hooks for more easily working with computed Jotai state
  - `useComputedAtom` - same interface as Jotai's `computed`, but as a React hook with no dependencies
  - `useAsAtom` - converts a `T | Atom<T>` to an `Atom<T>` as a React hook, so your APIs can be flexible.
- Utilities for binding to elements
  - `withSignal` - takes the name of a React intrinsic element and a mapping of React props to functions to update the element to create a new component that will update your element in real-time.
  - `mapProperty` - helper function for mapping a value to an element property
  - `mapAttribute` - helper function for mapping a value to an element attribute

Usage example, as a Storybook entry:

```tsx
import { Story, Meta } from '@storybook/react';
import { useMemo } from 'react';
import { tweenedAtom } from '@principlestudios/jotai-animation-atom';
import {
	useComputedAtom,
	mapAttribute,
	type PartialMapping,
	withSignal,
	useAsAtom,
} from '@principlestudios/jotai-react-signals';
import { Easing } from '@tweenjs/tween.js';

const sampleMapping = {
	cx: mapAttribute('cx'),
	cy: mapAttribute('cy'),
	r: mapAttribute('r'),
	strokeWidth: mapAttribute('stroke-width'),
} satisfies PartialMapping;

const AnimatedCircle = withSignal('circle', sampleMapping);

type Props = {
	size: number;
};

export default {
	title: 'Example/Jotai Signals',
	argTypes: {
		size: {
			control: {
				type: 'number',
			},
		},
	},
	parameters: {},
} as Meta<Props>;

const Template: Story<Props> = (args) => {
	const size$ = useAsAtom(args.size);
	const tweenedSize$ = useMemo(
		() => tweenedAtom(size$, Easing.Quadratic.Out),
		[size$]
	);
	const strokeWidth$ = useComputedAtom((get) => get(tweenedSize$) / 15);
	return (
		<svg width="300px" height="300px">
			<AnimatedCircle
				cx={150}
				cy={150}
				r={atom((get) => get(tweenedSize$).toFixed(3))}
				strokeWidth={atom((get) => get(strokeWidth$).toFixed(3))}
				stroke="red"
				fill="none"
			/>
		</svg>
	);
};

export const Primary = Template.bind({});
Primary.args = {
	size: 30,
};
```
npm package: @principlestudios/jotai-utilities
Description: 👻 Utilities for using Jotai
Author: Matt DeKrey
Latest version: 0.6.0

# Jotai Utilities

Includes common utilities not found in core Jotai but used by several other of our libraries. Built using imports on a per-utility basis for automatic tree-shaking.

## `isAtom`

Determines if a provided value is a Jotai `atom` or any other value.

Example:

```ts
import { type Atom, getDefaultStore } from 'jotai';
import { isAtom } from '@principlestudios/jotai-utilities/isAtom';

function currentValue<T>(someValue: Atom<T> | T): T {
	if (isAtom(someValue)) return getDefaultStore().get(someValue);
	return someValue;
}
```

## `currentValue`

Returns the value of the Atom provided or, if the value was not an atom, the value provided.

Example:

```ts
import { atom, type Atom } from 'jotai';
import { currentValue } from '@principlestudios/jotai-utilities/currentValue';

function getRange(
	min: Atom<number> | number,
	max: Atom<number> | number
): number {
	return currentValue(max) - currentValue(min);
}

function getRangeAtom(
	min: Atom<number> | number,
	max: Atom<number> | number
): Atom<number> {
	return atom((get) => currentValue(max, get) - currentValue(min, get));
}
```
npm package: @principlestudios/loadable
Description: Simple loadable construct
Author: Principle Studios, Matt DeKrey, Justin Myers
Latest version: 1.0.4

A simple structure indicating a value that may or may not be loaded, but also encapsulates
a range of intermediate states, including:

- Not yet loading
- Error states
- Loading with previous value
- Loading with no previous value

Used for:

- wrapping libraries for future compatability
- interop across project boundaries
- ensuring developers encapsulate all possible loading states in contract boundaries

This package also includes a few helpers for working with the structure, including creating
the structure and unwrapping it while following functional design patterns.