Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/afraid-lizards-show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect-atom/atom-solid": minor
---

add @effect-atom/atom-solid
153 changes: 153 additions & 0 deletions docs/atom-solid/Hooks.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
title: Hooks.ts
nav_order: 1
parent: "@effect-atom/atom-solid"
---

## Hooks overview

Added in v1.0.0

---

<h2 class="text-delta">Table of contents</h2>

- [hooks](#hooks)
- [useAtom](#useatom)
- [useAtomInitialValues](#useatominitialvalues)
- [useAtomMount](#useatommount)
- [useAtomRef](#useatomref)
- [useAtomRefProp](#useatomrefprop)
- [useAtomRefPropValue](#useatomrefpropvalue)
- [useAtomRefresh](#useatomrefresh)
- [useAtomSet](#useatomset)
- [useAtomSubscribe](#useatomsubscribe)
- [useAtomValue](#useatomvalue)

---

# hooks

## useAtom

**Signature**

```ts
export declare const useAtom: <R, W, const Mode extends "value" | "promise" | "promiseExit" = never>(
atom: Atom.Writable<R, W>,
options?: { readonly mode?: ([R] extends [Result.Result<any, any>] ? Mode : "value") | undefined }
) => readonly [
value: Accessor<R>,
write: "promise" extends Mode
? (value: W) => Promise<Result.Result.Success<R>>
: "promiseExit" extends Mode
? (value: W) => Promise<Exit.Exit<Result.Result.Success<R>, Result.Result.Failure<R>>>
: (value: W | ((value: R) => W)) => void
]
```

Added in v1.0.0

## useAtomInitialValues

**Signature**

```ts
export declare const useAtomInitialValues: (initialValues: Iterable<readonly [Atom.Atom<any>, any]>) => void
```

Added in v1.0.0

## useAtomMount

**Signature**

```ts
export declare const useAtomMount: <A>(atom: Atom.Atom<A>) => void
```

Added in v1.0.0

## useAtomRef

**Signature**

```ts
export declare const useAtomRef: <A>(ref: AtomRef.ReadonlyRef<A>) => Accessor<A>
```

Added in v1.0.0

## useAtomRefProp

**Signature**

```ts
export declare const useAtomRefProp: <A, K extends keyof A>(ref: AtomRef.AtomRef<A>, prop: K) => AtomRef.AtomRef<A[K]>
```

Added in v1.0.0

## useAtomRefPropValue

**Signature**

```ts
export declare const useAtomRefPropValue: <A, K extends keyof A>(ref: AtomRef.AtomRef<A>, prop: K) => Accessor<A[K]>
```

Added in v1.0.0

## useAtomRefresh

**Signature**

```ts
export declare const useAtomRefresh: <A>(atom: Atom.Atom<A>) => () => void
```

Added in v1.0.0

## useAtomSet

**Signature**

```ts
export declare const useAtomSet: <R, W, Mode extends "value" | "promise" | "promiseExit" = never>(
atom: Atom.Writable<R, W>,
options?: { readonly mode?: ([R] extends [Result.Result<any, any>] ? Mode : "value") | undefined }
) => "promise" extends Mode
? (value: W) => Promise<Result.Result.Success<R>>
: "promiseExit" extends Mode
? (value: W) => Promise<Exit.Exit<Result.Result.Success<R>, Result.Result.Failure<R>>>
: (value: W | ((value: R) => W)) => void
```

Added in v1.0.0

## useAtomSubscribe

**Signature**

```ts
export declare const useAtomSubscribe: <A>(
atom: Atom.Atom<A>,
f: (_: A) => void,
options?: { readonly immediate?: boolean }
) => void
```

Added in v1.0.0

## useAtomValue

**Signature**

```ts
export declare const useAtomValue: {
<A>(atom: Atom.Atom<A>): Accessor<A>
<A, B>(atom: Atom.Atom<A>, f: (_: A) => B): Accessor<B>
}
```

Added in v1.0.0
47 changes: 47 additions & 0 deletions docs/atom-solid/RegistryContext.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: RegistryContext.ts
nav_order: 3
parent: "@effect-atom/atom-solid"
---

## RegistryContext overview

Added in v1.0.0

---

<h2 class="text-delta">Table of contents</h2>

- [context](#context)
- [RegistryContext](#registrycontext)
- [RegistryProvider](#registryprovider)

---

# context

## RegistryContext

**Signature**

```ts
export declare const RegistryContext: Context<Registry.Registry>
```

Added in v1.0.0

## RegistryProvider

**Signature**

```ts
export declare const RegistryProvider: (options: {
readonly children?: JSX.Element | undefined
readonly initialValues?: Iterable<readonly [Atom.Atom<any>, any]> | undefined
readonly scheduleTask?: ((f: () => void) => void) | undefined
readonly timeoutResolution?: number | undefined
readonly defaultIdleTTL?: number | undefined
}) => any
```

Added in v1.0.0
6 changes: 6 additions & 0 deletions docs/atom-solid/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: "@effect-atom/atom-solid"
has_children: true
permalink: /docs/atom-solid
nav_order: 5
---
145 changes: 145 additions & 0 deletions docs/atom-solid/index.ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: index.ts
nav_order: 2
parent: "@effect-atom/atom-solid"
---

## index overview

Added in v1.0.0

---

<h2 class="text-delta">Table of contents</h2>

- [context](#context)
- [From "./RegistryContext.js"](#from-registrycontextjs)
- [exports](#exports)
- [From "@effect-atom/atom/Atom"](#from-effect-atomatomatom)
- [hooks](#hooks)
- [From "./Hooks.js"](#from-hooksjs)
- [re-exports](#re-exports)
- [From "@effect-atom/atom/AtomHttpApi"](#from-effect-atomatomatomhttpapi)
- [From "@effect-atom/atom/AtomRef"](#from-effect-atomatomatomref)
- [From "@effect-atom/atom/AtomRpc"](#from-effect-atomatomatomrpc)
- [From "@effect-atom/atom/Hydration"](#from-effect-atomatomhydration)
- [From "@effect-atom/atom/Registry"](#from-effect-atomatomregistry)
- [From "@effect-atom/atom/Result"](#from-effect-atomatomresult)

---

# context

## From "./RegistryContext.js"

Re-exports all named exports from the "./RegistryContext.js" module.

**Signature**

```ts
export * from "./RegistryContext.js"
```

Added in v1.0.0

# exports

## From "@effect-atom/atom/Atom"

Re-exports all named exports from the "@effect-atom/atom/Atom" module as `Atom`.

**Signature**

```ts
export * as Atom from "@effect-atom/atom/Atom"
```

Added in v1.0.0

# hooks

## From "./Hooks.js"

Re-exports all named exports from the "./Hooks.js" module.

**Signature**

```ts
export * from "./Hooks.js"
```

Added in v1.0.0

# re-exports

## From "@effect-atom/atom/AtomHttpApi"

Re-exports all named exports from the "@effect-atom/atom/AtomHttpApi" module as `AtomHttpApi`.

**Signature**

```ts
export * as AtomHttpApi from "@effect-atom/atom/AtomHttpApi"
```

Added in v1.0.0

## From "@effect-atom/atom/AtomRef"

Re-exports all named exports from the "@effect-atom/atom/AtomRef" module as `AtomRef`.

**Signature**

```ts
export * as AtomRef from "@effect-atom/atom/AtomRef"
```

Added in v1.0.0

## From "@effect-atom/atom/AtomRpc"

Re-exports all named exports from the "@effect-atom/atom/AtomRpc" module as `AtomRpc`.

**Signature**

```ts
export * as AtomRpc from "@effect-atom/atom/AtomRpc"
```

Added in v1.0.0

## From "@effect-atom/atom/Hydration"

Re-exports all named exports from the "@effect-atom/atom/Hydration" module as `Hydration`.

**Signature**

```ts
export * as Hydration from "@effect-atom/atom/Hydration"
```

Added in v1.0.0

## From "@effect-atom/atom/Registry"

Re-exports all named exports from the "@effect-atom/atom/Registry" module as `Registry`.

**Signature**

```ts
export * as Registry from "@effect-atom/atom/Registry"
```

Added in v1.0.0

## From "@effect-atom/atom/Result"

Re-exports all named exports from the "@effect-atom/atom/Result" module as `Result`.

**Signature**

```ts
export * as Result from "@effect-atom/atom/Result"
```

Added in v1.0.0
2 changes: 1 addition & 1 deletion docs/atom-vue/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
title: "@effect-atom/atom-vue"
has_children: true
permalink: /docs/atom-vue
nav_order: 5
nav_order: 6
---
14 changes: 14 additions & 0 deletions packages/atom-solid/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
coverage/
*.tsbuildinfo
node_modules/
.ultra.cache.json
.DS_Store
tmp/
build/
dist/
.direnv/

# files
/src/tsconfig.json
/dist

3 changes: 3 additions & 0 deletions packages/atom-solid/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.js
*.ts

2 changes: 2 additions & 0 deletions packages/atom-solid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Changelog

Loading