olova 2.0.11 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
- {
2
- "name": "olova",
3
- "version": "2.0.11",
4
- "description": "A lightweight JavaScript framework for building reactive applications.",
5
- "main": "dist/olova.js",
6
- "keywords": [
7
- "javascript",
8
- "framework",
9
- "reactive",
10
- "olova",
11
- "olovajs"
12
- ],
13
- "author": "Nazmul Hossain",
14
- "license": "MIT"
15
- }
1
+ {
2
+ "name": "olova",
3
+ "version": "2.0.13",
4
+ "description": "A lightweight JavaScript framework for building reactive applications.",
5
+ "main": "dist/olova.js",
6
+ "keywords": [
7
+ "javascript",
8
+ "framework",
9
+ "reactive",
10
+ "olova",
11
+ "olovajs"
12
+ ],
13
+ "author": "Nazmul Hossain",
14
+ "license": "MIT"
15
+ }
@@ -1,14 +0,0 @@
1
- import { currentEffect, setCurrentEffect } from "./createSignal";
2
- function createEffect(t) {
3
- const e = () => {
4
- f(), setCurrentEffect(e);
5
- try {
6
- f = t() || (() => {});
7
- } finally {
8
- setCurrentEffect(null);
9
- }
10
- };
11
- let f = () => {};
12
- e();
13
- }
14
- export { createEffect };
@@ -1,21 +0,0 @@
1
- import { $state, $effect } from "../olova.js";
2
- function createMemo(t, e = []) {
3
- const [o, s] = $state(void 0),
4
- [c, a] = $state(e),
5
- [i, r] = $state(void 0);
6
- return (
7
- $effect(() => {
8
- if (
9
- void 0 === i ||
10
- ((f = c),
11
- (o = e).length !== f.length || o.some((t, e) => !Object.is(t, f[e])))
12
- ) {
13
- const o = t();
14
- Object.is(o, i) || (r(o), s(o)), a(e);
15
- }
16
- var o, f;
17
- }),
18
- o
19
- );
20
- }
21
- export { createMemo };
@@ -1,13 +0,0 @@
1
- import { createSignal } from "./createSignal";
2
- function createRef(e = null) {
3
- const [r, t] = createSignal({ current: e });
4
- return {
5
- get current() {
6
- return r().current;
7
- },
8
- set current(e) {
9
- t({ current: e });
10
- },
11
- };
12
- }
13
- export { createRef };
@@ -1,13 +0,0 @@
1
- let currentEffect = null;
2
- const setCurrentEffect = (t) => {
3
- currentEffect = t;
4
- };
5
- function createSignal(t) {
6
- let e = t;
7
- const r = new Set();
8
- return [
9
- () => (currentEffect && r.add(currentEffect), e),
10
- (t) => ((e = "function" == typeof t ? t(e) : t), r.forEach((t) => t()), e),
11
- ];
12
- }
13
- export { createSignal, currentEffect, setCurrentEffect };