Comparing version 0.3.5 to 0.3.6
@@ -179,3 +179,3 @@ import S from 's-js'; | ||
if (j !== undefined && j !== -1) { | ||
temp[j] = mapped[i]; | ||
temp[j] = previous[i]; | ||
j = newIndicesNext[j]; | ||
@@ -182,0 +182,0 @@ newIndices.set(keyVal, j); |
@@ -78,2 +78,22 @@ # Signals | ||
### Composition | ||
State and Signals combine wonderfully as wrapping a state selector in a function instantly makes it reactive accessor. They encourage composing more sophisticated patterns to fit developer need. | ||
```js | ||
// deep reconciled immutable reducer | ||
const useReducer = (reducer, init) => { | ||
const [state, setState] = useState(init), | ||
[getAction, dispatch] = useSignal(); | ||
useEffect((prevState = init) => { | ||
let action, next; | ||
if (!(action = getAction())) return prevState; | ||
next = reducer(prevState, action); | ||
setState(reconcile(next)); | ||
return next; | ||
}) | ||
return [state, dispatch]; | ||
} | ||
``` | ||
### Observable | ||
@@ -80,0 +100,0 @@ |
@@ -37,3 +37,3 @@ # State | ||
{ | ||
mode: 'force' // type of comparison - default: 'default' | ||
mode: 'force', // type of comparison - default: 'default' | ||
key: '_id' // does a keyed comparison on arrays with key - default: 'id' | ||
@@ -40,0 +40,0 @@ } |
@@ -185,3 +185,3 @@ 'use strict'; | ||
if (j !== undefined && j !== -1) { | ||
temp[j] = mapped[i]; | ||
temp[j] = previous[i]; | ||
j = newIndicesNext[j]; | ||
@@ -188,0 +188,0 @@ newIndices.set(keyVal, j); |
{ | ||
"name": "solid-js", | ||
"description": "A declarative JavaScript library for building user interfaces.", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"author": "Ryan Carniato", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -192,4 +192,6 @@ # Solid.js | ||
* [Simple Todos](https://codepen.io/ryansolid/pen/ZqLoxo?editors=1000) on CodePen | ||
* [TodoMVC](https://github.com/ryansolid/solid-todomvc) | ||
* [JS Framework Benchmark](https://github.com/krausest/js-framework-benchmark/tree/master/frameworks/keyed/solid) | ||
* [TodoMVC](https://github.com/ryansolid/solid-todomvc) Classic TodoMVC example | ||
* [WebComponent Todos](https://github.com/shprink/web-components-todo/tree/master/solid) Showing off Solid with Web Components | ||
* [JS Framework Benchmark](https://github.com/krausest/js-framework-benchmark/tree/master/frameworks/keyed/solid) The one and only | ||
* [DBMon Benchmark](https://github.com/ryansolid/solid-dbmon) A benchmark testing ability of libraries to render unoptimized data. | ||
@@ -196,0 +198,0 @@ ## Related Projects |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
52436
210
0