1.9.1 • Published 5 months ago

solid-signals v1.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Solid Signals

Composable signals for SolidJS

All composable signals will extend the base SolidJS signal API by adding properties to accessors and setters, all fully typed.

Installation

$ npm install solid-signals

Usage

Basic

This example uses createHistory, see other signals in the Signals section

const [state, setState] = createHistory(0);

state(); // => 0
// Accessor extension
state.history(); // => [0]

setState(1);
state(); // => 1
state.history(); // => [0, 1]

// Setter extension
setState.history.back();
state(); // => 0
state.history(); // => [0]

setState.history.forward();
state(); // => 1
state.history(); // => [0, 1]

Composition

Signal composition is achieved by wrapping other signals with the .wrap method. This allows you to extend a signal with as many features as you'd like instead of using a single feature set provided by a traditional signal.

import { createArray, createHistory } from "solid-signals";

const [state, setState] = createHistory.wrap(createArray<number>([]));

// setState.push is provided by createArray
setState.push(1); // state() => [1]
setState.push(1, 2, 3); // state() => [1, 2, 3]

// setState.history.back is provided by createHistory
setState.history.back(); // state() => [1]

// Accessors can also be extended
// state.history is provided by createHistory
state.history(); // => [[], [1]]

Signals

Creating your own composable signal

(This api is not finalized)

You can create your own composable signal by using the signalExtender api, see createObject.ts for an example

1.9.1

5 months ago

1.9.0

8 months ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.2.6

1 year ago

1.6.1

1 year ago

1.4.3

1 year ago

1.2.5

1 year ago

1.6.0

1 year ago

1.4.2

1 year ago

1.2.4

1 year ago

1.4.1

1 year ago

1.2.3

1 year ago

1.4.0

1 year ago

1.2.2

1 year ago

1.3.10

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.5.5

1 year ago

1.3.7

1 year ago

1.5.4

1 year ago

1.3.6

1 year ago

1.5.3

1 year ago

1.3.5

1 year ago

1.5.2

1 year ago

1.3.4

1 year ago

1.5.1

1 year ago

1.3.3

1 year ago

1.5.0

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.18

2 years ago

0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.0

2 years ago