bunja 2.1.0 → 2.1.1

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/bunja.ts CHANGED
@@ -86,10 +86,7 @@ export class BunjaStore {
86
86
  #bakingContext: BunjaBakingContext | undefined;
87
87
  wrapInstance: WrapInstanceFn = defaultWrapInstanceFn;
88
88
  constructor() {
89
- if (__DEV__) {
90
- devtoolsGlobalHook.stores[this.id] = this;
91
- devtoolsGlobalHook.emit("storeCreated", { storeId: this.id });
92
- }
89
+ if (__DEV__) devtoolsGlobalHook.emit("storeCreated", { storeId: this.id });
93
90
  }
94
91
  get _internalState(): InternalState | undefined {
95
92
  if (__DEV__) {
@@ -110,10 +107,7 @@ export class BunjaStore {
110
107
  }
111
108
  this.#bunjas = {};
112
109
  this.#scopes = new Map();
113
- if (__DEV__) {
114
- devtoolsGlobalHook.emit("storeDisposed", { storeId: this.id });
115
- delete devtoolsGlobalHook.stores[this.id];
116
- }
110
+ if (__DEV__) devtoolsGlobalHook.emit("storeDisposed", { storeId: this.id });
117
111
  }
118
112
  get<T>(bunja: Bunja<T>, readScope: ReadScope): BunjaStoreGetResult<T> {
119
113
  const originalUse = bunjaFn.use;
@@ -524,7 +518,6 @@ const noop = () => {};
524
518
  export interface BunjaDevtoolsGlobalHook {
525
519
  bunjas: Record<string, Bunja<any>>;
526
520
  scopes: Record<string, Scope<any>>;
527
- stores: Record<string, BunjaStore>;
528
521
  listeners: Record<
529
522
  BunjaDevtoolsEventType,
530
523
  Set<(event: any) => void>
@@ -564,7 +557,6 @@ if (__DEV__) {
564
557
  devtoolsGlobalHook = (globalThis as any).__BUNJA_DEVTOOLS_GLOBAL_HOOK__;
565
558
  } else {
566
559
  devtoolsGlobalHook = {
567
- stores: {},
568
560
  bunjas: {},
569
561
  scopes: {},
570
562
  listeners: {
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@disjukr/bunja",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "license": "Zlib",
5
5
  "exports": {
6
6
  ".": "./bunja.ts",
@@ -96,7 +96,6 @@ declare class ScopeInstance extends RefCounter {
96
96
  interface BunjaDevtoolsGlobalHook {
97
97
  bunjas: Record<string, Bunja<any>>;
98
98
  scopes: Record<string, Scope<any>>;
99
- stores: Record<string, BunjaStore>;
100
99
  listeners: Record<BunjaDevtoolsEventType, Set<(event: any) => void>>;
101
100
  emit<T extends BunjaDevtoolsEventType>(type: T, event: BunjaDevtoolsEvent[T]): void;
102
101
  on<T extends BunjaDevtoolsEventType>(type: T, listener: (event: BunjaDevtoolsEvent[T]) => void): () => void;
@@ -96,7 +96,6 @@ declare class ScopeInstance extends RefCounter {
96
96
  interface BunjaDevtoolsGlobalHook {
97
97
  bunjas: Record<string, Bunja<any>>;
98
98
  scopes: Record<string, Scope<any>>;
99
- stores: Record<string, BunjaStore>;
100
99
  listeners: Record<BunjaDevtoolsEventType, Set<(event: any) => void>>;
101
100
  emit<T extends BunjaDevtoolsEventType>(type: T, event: BunjaDevtoolsEvent[T]): void;
102
101
  on<T extends BunjaDevtoolsEventType>(type: T, listener: (event: BunjaDevtoolsEvent[T]) => void): () => void;
@@ -35,10 +35,7 @@ var BunjaStore = class BunjaStore {
35
35
  #bakingContext;
36
36
  wrapInstance = defaultWrapInstanceFn;
37
37
  constructor() {
38
- if (__DEV__) {
39
- devtoolsGlobalHook.stores[this.id] = this;
40
- devtoolsGlobalHook.emit("storeCreated", { storeId: this.id });
41
- }
38
+ if (__DEV__) devtoolsGlobalHook.emit("storeCreated", { storeId: this.id });
42
39
  }
43
40
  get _internalState() {
44
41
  if (__DEV__) return {
@@ -54,10 +51,7 @@ var BunjaStore = class BunjaStore {
54
51
  for (const instanceMap of Object.values(this.#scopes)) for (const instance of instanceMap.values()) instance.dispose();
55
52
  this.#bunjas = {};
56
53
  this.#scopes = /* @__PURE__ */ new Map();
57
- if (__DEV__) {
58
- devtoolsGlobalHook.emit("storeDisposed", { storeId: this.id });
59
- delete devtoolsGlobalHook.stores[this.id];
60
- }
54
+ if (__DEV__) devtoolsGlobalHook.emit("storeDisposed", { storeId: this.id });
61
55
  }
62
56
  get(bunja$1, readScope) {
63
57
  const originalUse = bunjaFn.use;
@@ -368,7 +362,6 @@ let devtoolsGlobalHook;
368
362
  if (__DEV__) if (globalThis.__BUNJA_DEVTOOLS_GLOBAL_HOOK__) devtoolsGlobalHook = globalThis.__BUNJA_DEVTOOLS_GLOBAL_HOOK__;
369
363
  else {
370
364
  devtoolsGlobalHook = {
371
- stores: {},
372
365
  bunjas: {},
373
366
  scopes: {},
374
367
  listeners: {
@@ -34,10 +34,7 @@ var BunjaStore = class BunjaStore {
34
34
  #bakingContext;
35
35
  wrapInstance = defaultWrapInstanceFn;
36
36
  constructor() {
37
- if (__DEV__) {
38
- devtoolsGlobalHook.stores[this.id] = this;
39
- devtoolsGlobalHook.emit("storeCreated", { storeId: this.id });
40
- }
37
+ if (__DEV__) devtoolsGlobalHook.emit("storeCreated", { storeId: this.id });
41
38
  }
42
39
  get _internalState() {
43
40
  if (__DEV__) return {
@@ -53,10 +50,7 @@ var BunjaStore = class BunjaStore {
53
50
  for (const instanceMap of Object.values(this.#scopes)) for (const instance of instanceMap.values()) instance.dispose();
54
51
  this.#bunjas = {};
55
52
  this.#scopes = /* @__PURE__ */ new Map();
56
- if (__DEV__) {
57
- devtoolsGlobalHook.emit("storeDisposed", { storeId: this.id });
58
- delete devtoolsGlobalHook.stores[this.id];
59
- }
53
+ if (__DEV__) devtoolsGlobalHook.emit("storeDisposed", { storeId: this.id });
60
54
  }
61
55
  get(bunja$1, readScope) {
62
56
  const originalUse = bunjaFn.use;
@@ -367,7 +361,6 @@ let devtoolsGlobalHook;
367
361
  if (__DEV__) if (globalThis.__BUNJA_DEVTOOLS_GLOBAL_HOOK__) devtoolsGlobalHook = globalThis.__BUNJA_DEVTOOLS_GLOBAL_HOOK__;
368
362
  else {
369
363
  devtoolsGlobalHook = {
370
- stores: {},
371
364
  bunjas: {},
372
365
  scopes: {},
373
366
  listeners: {
package/dist/bunja.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_bunja = require('./bunja-DFFVW7Gi.cjs');
1
+ const require_bunja = require('./bunja-Ce8RwebF.cjs');
2
2
 
3
3
  exports.Bunja = require_bunja.Bunja;
4
4
  exports.BunjaStore = require_bunja.BunjaStore;
package/dist/bunja.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { Bunja, BunjaDevtoolsEvent, BunjaDevtoolsEventType, BunjaDevtoolsGlobalHook, BunjaEffectCallback, BunjaEffectFn, BunjaFn, BunjaForkFn, BunjaStore, BunjaStoreGetResult, BunjaUseFn, CreateBunjaStoreConfig, Dep, HashFn, ReadScope, Scope, ScopeValuePair, WrapInstanceFn, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-BKpQTG04.cjs";
1
+ import { Bunja, BunjaDevtoolsEvent, BunjaDevtoolsEventType, BunjaDevtoolsGlobalHook, BunjaEffectCallback, BunjaEffectFn, BunjaFn, BunjaForkFn, BunjaStore, BunjaStoreGetResult, BunjaUseFn, CreateBunjaStoreConfig, Dep, HashFn, ReadScope, Scope, ScopeValuePair, WrapInstanceFn, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-CPUl4ZRK.cjs";
2
2
  export { Bunja, BunjaDevtoolsEvent, BunjaDevtoolsEventType, BunjaDevtoolsGlobalHook, BunjaEffectCallback, BunjaEffectFn, BunjaFn, BunjaForkFn, BunjaStore, BunjaStoreGetResult, BunjaUseFn, CreateBunjaStoreConfig, Dep, HashFn, ReadScope, Scope, ScopeValuePair, WrapInstanceFn, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount };
package/dist/bunja.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { Bunja, BunjaDevtoolsEvent, BunjaDevtoolsEventType, BunjaDevtoolsGlobalHook, BunjaEffectCallback, BunjaEffectFn, BunjaFn, BunjaForkFn, BunjaStore, BunjaStoreGetResult, BunjaUseFn, CreateBunjaStoreConfig, Dep, HashFn, ReadScope, Scope, ScopeValuePair, WrapInstanceFn, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-B_HNgDan.js";
1
+ import { Bunja, BunjaDevtoolsEvent, BunjaDevtoolsEventType, BunjaDevtoolsGlobalHook, BunjaEffectCallback, BunjaEffectFn, BunjaFn, BunjaForkFn, BunjaStore, BunjaStoreGetResult, BunjaUseFn, CreateBunjaStoreConfig, Dep, HashFn, ReadScope, Scope, ScopeValuePair, WrapInstanceFn, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-BvZKLiEP.js";
2
2
  export { Bunja, BunjaDevtoolsEvent, BunjaDevtoolsEventType, BunjaDevtoolsGlobalHook, BunjaEffectCallback, BunjaEffectFn, BunjaFn, BunjaForkFn, BunjaStore, BunjaStoreGetResult, BunjaUseFn, CreateBunjaStoreConfig, Dep, HashFn, ReadScope, Scope, ScopeValuePair, WrapInstanceFn, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount };
package/dist/bunja.js CHANGED
@@ -1,3 +1,3 @@
1
- import { Bunja, BunjaStore, Scope, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-BOUkMIz6.js";
1
+ import { Bunja, BunjaStore, Scope, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-DhBgerdn.js";
2
2
 
3
3
  export { Bunja, BunjaStore, Scope, bunja, createBunjaStore, createReadScopeFn, createScope, delayUnmount };
package/dist/react.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  const require_chunk = require('./chunk-CUT6urMc.cjs');
5
- const require_bunja = require('./bunja-DFFVW7Gi.cjs');
5
+ const require_bunja = require('./bunja-Ce8RwebF.cjs');
6
6
  let react = require("react");
7
7
  react = require_chunk.__toESM(react);
8
8
 
package/dist/react.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-BKpQTG04.cjs";
1
+ import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-CPUl4ZRK.cjs";
2
2
  import { Context, PropsWithChildren } from "react";
3
3
 
4
4
  //#region react.d.ts
package/dist/react.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-B_HNgDan.js";
1
+ import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-BvZKLiEP.js";
2
2
  import { Context, PropsWithChildren } from "react";
3
3
 
4
4
  //#region react.d.ts
package/dist/react.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
 
4
- import { createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-BOUkMIz6.js";
4
+ import { createBunjaStore, createReadScopeFn, createScope, delayUnmount } from "./bunja-DhBgerdn.js";
5
5
  import { createContext, createElement, useContext, useEffect, useMemo, useState } from "react";
6
6
 
7
7
  //#region react.ts
package/dist/solid.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_bunja = require('./bunja-DFFVW7Gi.cjs');
2
+ const require_bunja = require('./bunja-Ce8RwebF.cjs');
3
3
  let solid_js = require("solid-js");
4
4
  solid_js = require_chunk.__toESM(solid_js);
5
5
 
package/dist/solid.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-BKpQTG04.cjs";
1
+ import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-CPUl4ZRK.cjs";
2
2
  import { Accessor, Context, JSX, ParentProps } from "solid-js";
3
3
 
4
4
  //#region solid.d.ts
package/dist/solid.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-B_HNgDan.js";
1
+ import { Bunja, BunjaStore, HashFn, Scope, ScopeValuePair } from "./bunja-BvZKLiEP.js";
2
2
  import { Accessor, Context, JSX, ParentProps } from "solid-js";
3
3
 
4
4
  //#region solid.d.ts
package/dist/solid.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createBunjaStore, createReadScopeFn, createScope } from "./bunja-BOUkMIz6.js";
1
+ import { createBunjaStore, createReadScopeFn, createScope } from "./bunja-DhBgerdn.js";
2
2
  import { createComponent, createContext, createEffect, createMemo, createRoot, getOwner, onCleanup, useContext } from "solid-js";
3
3
 
4
4
  //#region solid.ts
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bunja",
3
3
  "type": "module",
4
- "version": "2.1.0",
4
+ "version": "2.1.1",
5
5
  "description": "State Lifetime Manager",
6
6
  "main": "dist/bunja.cjs",
7
7
  "module": "dist/bunja.js",