open-index/open-npm huggingface dataset:
npm package: @joeldenning/single-spa-preact
Description: A single spa plugin for Preact apps
Author: Kent McLean
Latest version: 1.0.1

# single-spa-preact

Generic lifecycle hooks for Preact applications that are registered as [child applications](https://github.com/CanopyTax/single-spa/blob/master/docs/child-applications.md) of [single-spa](https://github.com/CanopyTax/single-spa).

## Quickstart

First, in the child application, run `npm install --save single-spa-preact` (or `jspm install npm:single-spa-preact` if your child application is managed by jspm). Then, in your [child app's entry file](https://github.com/CanopyTax/single-spa/blob/docs-1/docs/configuring-child-applications.md#the-entry-file), do the following:

```js
import preact from 'preact';
import rootComponent from './path-to-root-component.js';
import singleSpaPreact from 'single-spa-preact';

const reactLifecycles = singleSpaPreact({
  preact,
  rootComponent,
  domElementGetter: () => document.getElementById('main-content'),
});

export const bootstrap = [
  preactLifecycles.bootstrap,
];

export const mount = [
  preactLifecycles.mount,
];

export const unmount = [
  preactLifecycles.unmount,
];
```

## Options

All options are passed to single-spa-preact via the `opts` parameter when calling `singleSpaPreact(opts)`. The following options are available:

- `preact`: (required) The main Preact object, which is generally either exposed onto the window or is available via `require('preact')` `import preact from 'preact'`.
- `rootComponent`: (required) The top level preact component which will be rendered
- `domElementGetter`: (required) A function that takes in no arguments and returns a DOMElement. This dom element is where the React application will be bootstrapped, mounted, and unmounted.
npm package: @joeldodge/sdk-rtl
Description: Looker SDK Runtime Library
Author: Looker
Latest version: 21.1.0

# Looker SDK Runtime Library

BUMP The Looker Typescript/Javascript SDK depends on the runtime code in this package.

The source code in this package is almost all completely generic REST request/response processing code.

The `@joeldodge/sdk` package is updated with every Looker release. This package has a much longer update/release cycle.

**DISCLAIMER**: This is a _beta_ version of the Looker SDK runtime library. Implementations are still subject to change.
npm package: @joelegg/tinystore
Description: Tiny state manager for preact
Author: Joe Legg
Latest version: 0.3.0

# Tinystore
Tiny (333 B) state manager for preact inspired by svelte.

```
npm install @joelegg/tinystore
```

```typescript
// store.ts
import { createStore } from "tinystore"
export { store, increment, decrement, reset }

const store = createStore<number>(0)

const increment = () => store.set((state) => state + 1)
const decrement = () => store.set((state) => state - 1)
const reset = () => store.set(0)
```


```typescript
// app.ts
import { store, increment, decrement, reset } from "./store"

export const Increment = () => {
    return <button onclick={() => increment()}>+</button>
}

export const Decrement = () => {
    return <button onclick={() => decrement()}>-</button>
}

export const Reset = () => {
    return <button onclick={() => reset()}>Reset</button>
}

export const App = () => {
    const count = store.use()
    return (
        <>
            <Increment />
            <h1>{count}</h1>
            <Decrement />
            <br />
            <br />
            <Reset />
        </>
    )
}
```