@context-query/react 0.3.0-beta.1 → 0.3.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/dist/hooks.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import { TStateImpl } from "@context-query/core";
2
2
  import { createStoreContext } from "./context";
3
3
  export declare function createUseContextQuery<TState extends TStateImpl>(contexts: ReturnType<typeof createStoreContext<TState>>): <TKey extends keyof TState>(keys?: TKey[]) => readonly [{ [K in TKey]: TState[K]; }, (value: { [K in TKey]: TState[K]; } | ((prev: { [K in TKey]: TState[K]; }) => { [K in TKey]: TState[K]; })) => void];
4
+ export declare function createUseContextSetter<TState extends TStateImpl>(StoreContext: ReturnType<typeof createStoreContext<TState>>): () => (updater: Partial<TState> | ((prev: TState) => Partial<TState>)) => void;
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("react"),e=require("react/jsx-runtime");function s(e){return s=>{const r=(()=>{const s=t.useContext(e);if(!s)throw new Error("useContextQuery must be used within a ContextQueryProvider");return s})(),n=s??Object.keys(r.getState()),i=()=>n.reduce(((t,e)=>({...t,[e]:r.getStateByKey(e)})),{}),[o,u]=t.useState(i);t.useEffect((()=>{const t=(t,e)=>{u((s=>({...s,[t]:e})))},e=n.map((e=>r.subscribe(e,t)));return()=>{e.forEach((t=>t.unsubscribe()))}}),[n,r]);return[o,t.useCallback((t=>{const e=i(),s="function"==typeof t?t(e):t;Object.entries(s).forEach((([t,e])=>{r.setState(t,e)}))}),[n,r])]}}class r{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const e={...this.state};this.state={...t},Object.keys(t).forEach((t=>{Object.is(e[t],this.state[t])||this.notifyListeners(t)}))}setState(t,e){Object.is(this.state[t],e)||(this.state={...this.state,[t]:e},this.notifyListeners(t))}notifyListeners(t){const e=this.listeners.get(t);if(e){const s=this.state[t];e.forEach((t=>t(s)))}}subscribe(t,e){const s=s=>{e(t,s)};return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(s),{unsubscribe:()=>{const e=this.listeners.get(t);e&&(e.delete(s),0===e.size&&this.listeners.delete(t))}}}}function n(){const s=t.createContext(null);return{ContextQueryProvider:function({children:n,initialState:i}){const o=t.useMemo((()=>new r(i)),[i]);return e.jsx(s.Provider,{value:o,children:n})},StoreContext:s}}exports.createContextQuery=function(){const{ContextQueryProvider:t,StoreContext:e}=n();return{ContextQueryProvider:t,useContextQuery:s(e)}};
1
+ "use strict";var t=require("react"),e=require("react/jsx-runtime");function s(e){return s=>{const r=(()=>{const s=t.useContext(e);if(!s)throw new Error("useContextQuery must be used within a ContextQueryProvider");return s})(),n=s??Object.keys(r.getState()),i=()=>n.reduce(((t,e)=>({...t,[e]:r.getStateByKey(e)})),{}),[o,u]=t.useState(i);t.useEffect((()=>{const t=(t,e)=>{u((s=>({...s,[t]:e})))},e=n.map((e=>r.subscribe(e,t)));return()=>{e.forEach((t=>t.unsubscribe()))}}),[n,r]);return[o,t.useCallback((t=>{const e=i(),s="function"==typeof t?t(e):t;Object.entries(s).forEach((([t,e])=>{r.setState(t,e)}))}),[n,r])]}}class r{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const e={...this.state};this.state={...t},Object.keys(t).forEach((t=>{Object.is(e[t],this.state[t])||this.notifyListeners(t)}))}setState(t,e){Object.is(this.state[t],e)||(this.state={...this.state,[t]:e},this.notifyListeners(t))}notifyListeners(t){const e=this.listeners.get(t);if(e){const s=this.state[t];e.forEach((t=>t(s)))}}subscribe(t,e){const s=s=>{e(t,s)};return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(s),{unsubscribe:()=>{const e=this.listeners.get(t);e&&(e.delete(s),0===e.size&&this.listeners.delete(t))}}}}function n(){const s=t.createContext(null);return{ContextQueryProvider:function({children:n,initialState:i}){const o=t.useMemo((()=>new r(i)),[i]);return e.jsx(s.Provider,{value:o,children:n})},StoreContext:s}}exports.createContextQuery=function(){const{ContextQueryProvider:e,StoreContext:r}=n(),i=s(r),o=function(e){return()=>{const s=t.useContext(e);if(!s)throw new Error("useContextSetter must be used within a ContextQueryProvider");return t.useCallback((t=>{const e=s.getState(),r="function"==typeof t?t(e):t;Object.entries(r).forEach((([t,e])=>{s.setState(t,e)}))}),[s])}}(r);return{ContextQueryProvider:e,useContextQuery:i,useContextSetter:o}};
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/hooks.ts","../../../node_modules/.pnpm/@context-query+core@0.3.0-beta.1/node_modules/@context-query/core/dist/index.mjs","../src/provider.tsx","../src/context.ts","../src/index.ts"],"sourcesContent":["import { TStateImpl } from \"@context-query/core\";\nimport { useCallback, useContext, useEffect, useState } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createUseContextQuery<TState extends TStateImpl>(\n contexts: ReturnType<typeof createStoreContext<TState>>\n) {\n const useStore = () => {\n const store = useContext(contexts);\n\n if (!store) {\n throw new Error(\n \"useContextQuery must be used within a ContextQueryProvider\"\n );\n }\n\n return store;\n };\n\n return <TKey extends keyof TState>(keys?: TKey[]) => {\n const store = useStore();\n const localKeys = keys ?? (Object.keys(store.getState()) as TKey[]);\n\n type StateSubset = { [K in TKey]: TState[K] };\n\n const getStateSubset = (): StateSubset => {\n return localKeys.reduce(\n (acc, key) => ({ ...acc, [key]: store.getStateByKey(key) }),\n {} as StateSubset\n );\n };\n\n const [state, setLocalState] = useState<StateSubset>(getStateSubset);\n\n useEffect(() => {\n const handleChange = (key: TKey, newValue: TState[TKey]) => {\n setLocalState((prev) => ({ ...prev, [key]: newValue }));\n };\n\n const subscriptions = localKeys.map((key) =>\n store.subscribe(key, handleChange)\n );\n\n return () => {\n subscriptions.forEach((sub) => sub.unsubscribe());\n };\n }, [localKeys, store]);\n\n const setState = useCallback(\n (value: StateSubset | ((prev: StateSubset) => StateSubset)) => {\n const currentValue = getStateSubset();\n const updatedValue =\n typeof value === \"function\"\n ? (value as Function)(currentValue)\n : value;\n\n Object.entries(updatedValue).forEach(([k, v]) => {\n store.setState(k as TKey, v as TState[TKey]);\n });\n },\n [localKeys, store]\n );\n\n return [state, setState] as const;\n };\n}\n","class t{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const s={...this.state};this.state={...t};Object.keys(t).forEach((t=>{Object.is(s[t],this.state[t])||this.notifyListeners(t)}))}setState(t,s){Object.is(this.state[t],s)||(this.state={...this.state,[t]:s},this.notifyListeners(t))}notifyListeners(t){const s=this.listeners.get(t);if(s){const e=this.state[t];s.forEach((t=>t(e)))}}subscribe(t,s){const e=e=>{s(t,e)};this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e);return{unsubscribe:()=>{const s=this.listeners.get(t);s&&(s.delete(e),0===s.size&&this.listeners.delete(t))}}}}export{t as ContextQueryStore};\n//# sourceMappingURL=index.mjs.map\n","import { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createReactContextQuery<TState extends TStateImpl>() {\n const StoreContext = createStoreContext<TState>();\n const ContextQueryProvider = function ContextQueryProvider({\n children,\n initialState,\n }: PropsWithChildren<TState>) {\n const store = useMemo(\n () => new ContextQueryStore<TState>(initialState),\n [initialState]\n );\n\n return (\n <StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n );\n };\n\n return {\n ContextQueryProvider,\n StoreContext,\n };\n}\n","import type { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { createContext } from \"react\";\n\nexport const createStoreContext = <TState extends TStateImpl>() => {\n return createContext<ContextQueryStore<TState> | null>(null);\n};\n","import { TStateImpl } from \"@context-query/core\";\nimport { createUseContextQuery } from \"./hooks\";\nimport { createReactContextQuery } from \"./provider\";\n\nexport function createContextQuery<TState extends TStateImpl>() {\n const { ContextQueryProvider, StoreContext } =\n createReactContextQuery<TState>();\n const useContextQuery = createUseContextQuery<TState>(StoreContext);\n return {\n ContextQueryProvider,\n useContextQuery,\n };\n}\n"],"names":["createUseContextQuery","contexts","keys","store","useContext","Error","useStore","localKeys","Object","getState","getStateSubset","reduce","acc","key","getStateByKey","state","setLocalState","useState","useEffect","handleChange","newValue","prev","subscriptions","map","subscribe","forEach","sub","unsubscribe","useCallback","value","currentValue","updatedValue","entries","k","v","setState","t","listeners","constructor","this","Map","updateState","s","is","notifyListeners","get","e","has","set","Set","add","delete","size","createReactContextQuery","StoreContext","createContext","ContextQueryProvider","children","initialState","useMemo","ContextQueryStore","_jsx","jsx","Provider","useContextQuery"],"mappings":"mEAIM,SAAUA,EACdC,GAcA,OAAmCC,IACjC,MAAMC,EAbS,MACf,MAAMA,EAAQC,EAAUA,WAACH,GAEzB,IAAKE,EACH,MAAM,IAAIE,MACR,8DAIJ,OAAOF,CAAK,EAIEG,GACRC,EAAYL,GAASM,OAAON,KAAKC,EAAMM,YAIvCC,EAAiB,IACdH,EAAUI,QACf,CAACC,EAAKC,KAAS,IAAKD,EAAKC,CAACA,GAAMV,EAAMW,cAAcD,MACpD,CAAA,IAIGE,EAAOC,GAAiBC,EAAAA,SAAsBP,GAErDQ,EAAAA,WAAU,KACR,MAAMC,EAAe,CAACN,EAAWO,KAC/BJ,GAAeK,QAAeA,EAAMR,CAACA,GAAMO,KAAY,EAGnDE,EAAgBf,EAAUgB,KAAKV,GACnCV,EAAMqB,UAAUX,EAAKM,KAGvB,MAAO,KACLG,EAAcG,SAASC,GAAQA,EAAIC,eAAc,CAClD,GACA,CAACpB,EAAWJ,IAiBf,MAAO,CAACY,EAfSa,eACdC,IACC,MAAMC,EAAepB,IACfqB,EACa,mBAAVF,EACFA,EAAmBC,GACpBD,EAENrB,OAAOwB,QAAQD,GAAcN,SAAQ,EAAEQ,EAAGC,MACxC/B,EAAMgC,SAASF,EAAWC,EAAkB,G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2B,UAA8BC,SACzDA,EAAQC,aACRA,IAEA,MAAMvD,EAAQwD,EAAAA,SACZ,IAAM,IAAIC,EAA0BF,IACpC,CAACA,IAGH,OACEG,EAAAC,IAACR,EAAaS,SAAQ,CAAClC,MAAO1B,EAAKsD,SAAGA,GAEzC,EAICH,eAEJ,uCEnBE,MAAME,qBAAEA,EAAoBF,aAAEA,GAC5BD,IAEF,MAAO,CACLG,uBACAQ,gBAHsBhE,EAA8BsD,GAKxD","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"index.cjs","sources":["../src/hooks.ts","../../../node_modules/.pnpm/@context-query+core@0.3.0-beta.1/node_modules/@context-query/core/dist/index.mjs","../src/provider.tsx","../src/context.ts","../src/index.ts"],"sourcesContent":["import { TStateImpl } from \"@context-query/core\";\nimport { useCallback, useContext, useEffect, useState } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createUseContextQuery<TState extends TStateImpl>(\n contexts: ReturnType<typeof createStoreContext<TState>>\n) {\n const useStore = () => {\n const store = useContext(contexts);\n\n if (!store) {\n throw new Error(\n \"useContextQuery must be used within a ContextQueryProvider\"\n );\n }\n\n return store;\n };\n\n return <TKey extends keyof TState>(keys?: TKey[]) => {\n const store = useStore();\n const localKeys = keys ?? (Object.keys(store.getState()) as TKey[]);\n\n type StateSubset = { [K in TKey]: TState[K] };\n\n const getStateSubset = (): StateSubset => {\n return localKeys.reduce(\n (acc, key) => ({ ...acc, [key]: store.getStateByKey(key) }),\n {} as StateSubset\n );\n };\n\n const [state, setLocalState] = useState<StateSubset>(getStateSubset);\n\n useEffect(() => {\n const handleChange = (key: TKey, newValue: TState[TKey]) => {\n setLocalState((prev) => ({ ...prev, [key]: newValue }));\n };\n\n const subscriptions = localKeys.map((key) =>\n store.subscribe(key, handleChange)\n );\n\n return () => {\n subscriptions.forEach((sub) => sub.unsubscribe());\n };\n }, [localKeys, store]);\n\n const setState = useCallback(\n (value: StateSubset | ((prev: StateSubset) => StateSubset)) => {\n const currentValue = getStateSubset();\n const updatedValue =\n typeof value === \"function\"\n ? (value as Function)(currentValue)\n : value;\n\n Object.entries(updatedValue).forEach(([k, v]) => {\n store.setState(k as TKey, v as TState[TKey]);\n });\n },\n [localKeys, store]\n );\n\n return [state, setState] as const;\n };\n}\n\nexport function createUseContextSetter<TState extends TStateImpl>(\n StoreContext: ReturnType<typeof createStoreContext<TState>>\n) {\n return () => {\n const store = useContext(StoreContext);\n \n if (!store) {\n throw new Error(\"useContextSetter must be used within a ContextQueryProvider\");\n }\n \n const setState = useCallback((updater: Partial<TState> | ((prev: TState) => Partial<TState>)) => {\n const currentState = store.getState();\n const newState = typeof updater === 'function' ? updater(currentState) : updater;\n \n Object.entries(newState).forEach(([key, value]) => {\n store.setState(key as keyof TState, value as TState[keyof TState]);\n });\n }, [store]);\n \n return setState;\n };\n}\n","class t{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const s={...this.state};this.state={...t};Object.keys(t).forEach((t=>{Object.is(s[t],this.state[t])||this.notifyListeners(t)}))}setState(t,s){Object.is(this.state[t],s)||(this.state={...this.state,[t]:s},this.notifyListeners(t))}notifyListeners(t){const s=this.listeners.get(t);if(s){const e=this.state[t];s.forEach((t=>t(e)))}}subscribe(t,s){const e=e=>{s(t,e)};this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e);return{unsubscribe:()=>{const s=this.listeners.get(t);s&&(s.delete(e),0===s.size&&this.listeners.delete(t))}}}}export{t as ContextQueryStore};\n//# sourceMappingURL=index.mjs.map\n","import { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createReactContextQuery<TState extends TStateImpl>() {\n const StoreContext = createStoreContext<TState>();\n const ContextQueryProvider = function ContextQueryProvider({\n children,\n initialState,\n }: PropsWithChildren<TState>) {\n const store = useMemo(\n () => new ContextQueryStore<TState>(initialState),\n [initialState]\n );\n\n return (\n <StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n );\n };\n\n return {\n ContextQueryProvider,\n StoreContext,\n };\n}\n","import type { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { createContext } from \"react\";\n\nexport const createStoreContext = <TState extends TStateImpl>() => {\n return createContext<ContextQueryStore<TState> | null>(null);\n};\n","import { TStateImpl } from \"@context-query/core\";\nimport { createUseContextQuery, createUseContextSetter } from \"./hooks\";\nimport { createReactContextQuery } from \"./provider\";\n\nexport function createContextQuery<TState extends TStateImpl>() {\n const { ContextQueryProvider, StoreContext } =\n createReactContextQuery<TState>();\n const useContextQuery = createUseContextQuery<TState>(StoreContext);\n const useContextSetter = createUseContextSetter<TState>(StoreContext);\n return {\n ContextQueryProvider,\n useContextQuery,\n useContextSetter,\n };\n}\n"],"names":["createUseContextQuery","contexts","keys","store","useContext","Error","useStore","localKeys","Object","getState","getStateSubset","reduce","acc","key","getStateByKey","state","setLocalState","useState","useEffect","handleChange","newValue","prev","subscriptions","map","subscribe","forEach","sub","unsubscribe","useCallback","value","currentValue","updatedValue","entries","k","v","setState","t","listeners","constructor","this","Map","updateState","s","is","notifyListeners","get","e","has","set","Set","add","delete","size","createReactContextQuery","StoreContext","createContext","ContextQueryProvider","children","initialState","useMemo","ContextQueryStore","_jsx","jsx","Provider","useContextQuery","useContextSetter","updater","currentState","newState","createUseContextSetter"],"mappings":"mEAIM,SAAUA,EACdC,GAcA,OAAmCC,IACjC,MAAMC,EAbS,MACf,MAAMA,EAAQC,EAAUA,WAACH,GAEzB,IAAKE,EACH,MAAM,IAAIE,MACR,8DAIJ,OAAOF,CAAK,EAIEG,GACRC,EAAYL,GAASM,OAAON,KAAKC,EAAMM,YAIvCC,EAAiB,IACdH,EAAUI,QACf,CAACC,EAAKC,KAAS,IAAKD,EAAKC,CAACA,GAAMV,EAAMW,cAAcD,MACpD,CAAA,IAIGE,EAAOC,GAAiBC,EAAAA,SAAsBP,GAErDQ,EAAAA,WAAU,KACR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EAAEM,GAAG,MAAMI,EAAEA,IAAIJ,EAAEN,EAAEU,EAAC,EAAqF,OAAlFP,KAAKF,UAAUU,IAAIX,IAAIG,KAAKF,UAAUW,IAAIZ,EAAE,IAAIa,KAAKV,KAAKF,UAAUQ,IAAIT,GAAGc,IAAIJ,GAAS,CAACnB,YAAY,KAAK,MAAMe,EAAEH,KAAKF,UAAUQ,IAAIT,GAAGM,IAAIA,EAAES,OAAOL,GAAG,IAAIJ,EAAEU,MAAMb,KAAKF,UAAUc,OAAOf,GAAG,EAAE,WCIvrBiB,IACd,MAAMC,ECDCC,EAAAA,cAAgD,MDgBvD,MAAO,CACLC,qBAf2B,UAA8BC,SACzDA,EAAQC,aACRA,IAEA,MAAMvD,EAAQwD,EAAAA,SACZ,IAAM,IAAIC,EAA0BF,IACpC,CAACA,IAGH,OACEG,EAAAC,IAACR,EAAaS,SAAQ,CAAClC,MAAO1B,EAAKsD,SAAGA,GAEzC,EAICH,eAEJ,uCEnBE,MAAME,qBAAEA,EAAoBF,aAAEA,GAC5BD,IACIW,EAAkBhE,EAA8BsD,GAChDW,EJ2DF,SACJX,GAEA,MAAO,KACL,MAAMnD,EAAQC,EAAUA,WAACkD,GAEzB,IAAKnD,EACH,MAAM,IAAIE,MAAM,+DAYlB,OATiBuB,eAAasC,IAC5B,MAAMC,EAAehE,EAAMM,WACrB2D,EAA8B,mBAAZF,EAAyBA,EAAQC,GAAgBD,EAEzE1D,OAAOwB,QAAQoC,GAAU3C,SAAQ,EAAEZ,EAAKgB,MACtC1B,EAAMgC,SAAStB,EAAqBgB,EAA8B,GAClE,GACD,CAAC1B,GAEW,CAEnB,CIhF2BkE,CAA+Bf,GACxD,MAAO,CACLE,uBACAQ,kBACAC,mBAEJ","x_google_ignoreList":[1]}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ import { TStateImpl } from "@context-query/core";
2
2
  export declare function createContextQuery<TState extends TStateImpl>(): {
3
3
  ContextQueryProvider: ({ children, initialState, }: import("react").PropsWithChildren<TState>) => import("react/jsx-runtime").JSX.Element;
4
4
  useContextQuery: <TKey extends keyof TState>(keys?: TKey[] | undefined) => readonly [{ [K in TKey]: TState[K]; }, (value: { [K in TKey]: TState[K]; } | ((prev: { [K in TKey]: TState[K]; }) => { [K in TKey]: TState[K]; })) => void];
5
+ useContextSetter: () => (updater: Partial<TState> | ((prev: TState) => Partial<TState>)) => void;
5
6
  };
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import{useState as t,useEffect as e,useCallback as s,useContext as r,createContext as n,useMemo as i}from"react";import{jsx as o}from"react/jsx-runtime";function c(n){return i=>{const o=(()=>{const t=r(n);if(!t)throw new Error("useContextQuery must be used within a ContextQueryProvider");return t})(),c=i??Object.keys(o.getState()),u=()=>c.reduce(((t,e)=>({...t,[e]:o.getStateByKey(e)})),{}),[a,h]=t(u);e((()=>{const t=(t,e)=>{h((s=>({...s,[t]:e})))},e=c.map((e=>o.subscribe(e,t)));return()=>{e.forEach((t=>t.unsubscribe()))}}),[c,o]);return[a,s((t=>{const e=u(),s="function"==typeof t?t(e):t;Object.entries(s).forEach((([t,e])=>{o.setState(t,e)}))}),[c,o])]}}class u{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const e={...this.state};this.state={...t},Object.keys(t).forEach((t=>{Object.is(e[t],this.state[t])||this.notifyListeners(t)}))}setState(t,e){Object.is(this.state[t],e)||(this.state={...this.state,[t]:e},this.notifyListeners(t))}notifyListeners(t){const e=this.listeners.get(t);if(e){const s=this.state[t];e.forEach((t=>t(s)))}}subscribe(t,e){const s=s=>{e(t,s)};return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(s),{unsubscribe:()=>{const e=this.listeners.get(t);e&&(e.delete(s),0===e.size&&this.listeners.delete(t))}}}}function a(){const t=n(null);return{ContextQueryProvider:function({children:e,initialState:s}){const r=i((()=>new u(s)),[s]);return o(t.Provider,{value:r,children:e})},StoreContext:t}}function h(){const{ContextQueryProvider:t,StoreContext:e}=a();return{ContextQueryProvider:t,useContextQuery:c(e)}}export{h as createContextQuery};
1
+ import{useContext as t,useCallback as e,useState as s,useEffect as r,createContext as n,useMemo as i}from"react";import{jsx as o}from"react/jsx-runtime";function u(n){return i=>{const o=(()=>{const e=t(n);if(!e)throw new Error("useContextQuery must be used within a ContextQueryProvider");return e})(),u=i??Object.keys(o.getState()),c=()=>u.reduce(((t,e)=>({...t,[e]:o.getStateByKey(e)})),{}),[a,h]=s(c);r((()=>{const t=(t,e)=>{h((s=>({...s,[t]:e})))},e=u.map((e=>o.subscribe(e,t)));return()=>{e.forEach((t=>t.unsubscribe()))}}),[u,o]);return[a,e((t=>{const e=c(),s="function"==typeof t?t(e):t;Object.entries(s).forEach((([t,e])=>{o.setState(t,e)}))}),[u,o])]}}class c{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const e={...this.state};this.state={...t},Object.keys(t).forEach((t=>{Object.is(e[t],this.state[t])||this.notifyListeners(t)}))}setState(t,e){Object.is(this.state[t],e)||(this.state={...this.state,[t]:e},this.notifyListeners(t))}notifyListeners(t){const e=this.listeners.get(t);if(e){const s=this.state[t];e.forEach((t=>t(s)))}}subscribe(t,e){const s=s=>{e(t,s)};return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(s),{unsubscribe:()=>{const e=this.listeners.get(t);e&&(e.delete(s),0===e.size&&this.listeners.delete(t))}}}}function a(){const t=n(null);return{ContextQueryProvider:function({children:e,initialState:s}){const r=i((()=>new c(s)),[s]);return o(t.Provider,{value:r,children:e})},StoreContext:t}}function h(){const{ContextQueryProvider:s,StoreContext:r}=a(),n=u(r),i=function(s){return()=>{const r=t(s);if(!r)throw new Error("useContextSetter must be used within a ContextQueryProvider");return e((t=>{const e=r.getState(),s="function"==typeof t?t(e):t;Object.entries(s).forEach((([t,e])=>{r.setState(t,e)}))}),[r])}}(r);return{ContextQueryProvider:s,useContextQuery:n,useContextSetter:i}}export{h as createContextQuery};
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/hooks.ts","../../../node_modules/.pnpm/@context-query+core@0.3.0-beta.1/node_modules/@context-query/core/dist/index.mjs","../src/provider.tsx","../src/context.ts","../src/index.ts"],"sourcesContent":["import { TStateImpl } from \"@context-query/core\";\nimport { useCallback, useContext, useEffect, useState } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createUseContextQuery<TState extends TStateImpl>(\n contexts: ReturnType<typeof createStoreContext<TState>>\n) {\n const useStore = () => {\n const store = useContext(contexts);\n\n if (!store) {\n throw new Error(\n \"useContextQuery must be used within a ContextQueryProvider\"\n );\n }\n\n return store;\n };\n\n return <TKey extends keyof TState>(keys?: TKey[]) => {\n const store = useStore();\n const localKeys = keys ?? (Object.keys(store.getState()) as TKey[]);\n\n type StateSubset = { [K in TKey]: TState[K] };\n\n const getStateSubset = (): StateSubset => {\n return localKeys.reduce(\n (acc, key) => ({ ...acc, [key]: store.getStateByKey(key) }),\n {} as StateSubset\n );\n };\n\n const [state, setLocalState] = useState<StateSubset>(getStateSubset);\n\n useEffect(() => {\n const handleChange = (key: TKey, newValue: TState[TKey]) => {\n setLocalState((prev) => ({ ...prev, [key]: newValue }));\n };\n\n const subscriptions = localKeys.map((key) =>\n store.subscribe(key, handleChange)\n );\n\n return () => {\n subscriptions.forEach((sub) => sub.unsubscribe());\n };\n }, [localKeys, store]);\n\n const setState = useCallback(\n (value: StateSubset | ((prev: StateSubset) => StateSubset)) => {\n const currentValue = getStateSubset();\n const updatedValue =\n typeof value === \"function\"\n ? (value as Function)(currentValue)\n : value;\n\n Object.entries(updatedValue).forEach(([k, v]) => {\n store.setState(k as TKey, v as TState[TKey]);\n });\n },\n [localKeys, store]\n );\n\n return [state, setState] as const;\n };\n}\n","class t{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const s={...this.state};this.state={...t};Object.keys(t).forEach((t=>{Object.is(s[t],this.state[t])||this.notifyListeners(t)}))}setState(t,s){Object.is(this.state[t],s)||(this.state={...this.state,[t]:s},this.notifyListeners(t))}notifyListeners(t){const s=this.listeners.get(t);if(s){const e=this.state[t];s.forEach((t=>t(e)))}}subscribe(t,s){const e=e=>{s(t,e)};this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e);return{unsubscribe:()=>{const s=this.listeners.get(t);s&&(s.delete(e),0===s.size&&this.listeners.delete(t))}}}}export{t as ContextQueryStore};\n//# sourceMappingURL=index.mjs.map\n","import { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createReactContextQuery<TState extends TStateImpl>() {\n const StoreContext = createStoreContext<TState>();\n const ContextQueryProvider = function ContextQueryProvider({\n children,\n initialState,\n }: PropsWithChildren<TState>) {\n const store = useMemo(\n () => new ContextQueryStore<TState>(initialState),\n [initialState]\n );\n\n return (\n <StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n );\n };\n\n return {\n ContextQueryProvider,\n StoreContext,\n };\n}\n","import type { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { createContext } from \"react\";\n\nexport const createStoreContext = <TState extends TStateImpl>() => {\n return createContext<ContextQueryStore<TState> | null>(null);\n};\n","import { TStateImpl } from \"@context-query/core\";\nimport { createUseContextQuery } from \"./hooks\";\nimport { createReactContextQuery } from \"./provider\";\n\nexport function createContextQuery<TState extends TStateImpl>() {\n const { ContextQueryProvider, StoreContext } =\n createReactContextQuery<TState>();\n const useContextQuery = createUseContextQuery<TState>(StoreContext);\n return {\n ContextQueryProvider,\n useContextQuery,\n };\n}\n"],"names":["createUseContextQuery","contexts","keys","store","useContext","Error","useStore","localKeys","Object","getState","getStateSubset","reduce","acc","key","getStateByKey","state","setLocalState","useState","useEffect","handleChange","newValue","prev","subscriptions","map","subscribe","forEach","sub","unsubscribe","useCallback","value","currentValue","updatedValue","entries","k","v","setState","t","listeners","constructor","this","Map","updateState","s","is","notifyListeners","get","e","has","set","Set","add","delete","size","createReactContextQuery","StoreContext","createContext","ContextQueryProvider","children","initialState","useMemo","ContextQueryStore","_jsx","Provider","createContextQuery","useContextQuery"],"mappings":"yJAIM,SAAUA,EACdC,GAcA,OAAmCC,IACjC,MAAMC,EAbS,MACf,MAAMA,EAAQC,EAAWH,GAEzB,IAAKE,EACH,MAAM,IAAIE,MACR,8DAIJ,OAAOF,CAAK,EAIEG,GACRC,EAAYL,GAASM,OAAON,KAAKC,EAAMM,YAIvCC,EAAiB,IACdH,EAAUI,QACf,CAACC,EAAKC,KAAS,IAAKD,EAAKC,CAACA,GAAMV,EAAMW,cAAcD,MACpD,CAAA,IAIGE,EAAOC,GAAiBC,EAAsBP,GAErDQ,GAAU,KACR,MAAMC,EAAe,CAACN,EAAWO,KAC/BJ,GAAeK,QAAeA,EAAMR,CAACA,GAAMO,KAAY,EAGnDE,EAAgBf,EAAUgB,KAAKV,GACnCV,EAAMqB,UAAUX,EAAKM,KAGvB,MAAO,KACLG,EAAcG,SAASC,GAAQA,EAAIC,eAAc,CAClD,GACA,CAACpB,EAAWJ,IAiBf,MAAO,CAACY,EAfSa,GACdC,IACC,MAAMC,EAAepB,IACfqB,EACa,mBAAVF,EACFA,EAAmBC,GACpBD,EAENrB,OAAOwB,QAAQD,GAAcN,SAAQ,EAAEQ,EAAGC,MACxC/B,EAAMgC,SAASF,EAAWC,EAAkB,GAC5C,GAEJ,CAAC3B,EAAWJ,IAGmB,CAErC,CCjEA,MAAMiC,EAAErB,MAAMsB,UAAU,WAAAC,CAAYF,GAAGG,KAAKxB,MAAMqB,EAAEG,KAAKF,UAAU,IAAIG,GAAG,CAAC,QAAA/B,GAAW,OAAO8B,KAAKxB,KAAK,CAAC,aAAAD,CAAcsB,GAAG,OAAOG,KAAKxB,MAAMqB,EAAE,CAAC,WAAAK,CA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BsD,GAKxD","x_google_ignoreList":[1]}
1
+ {"version":3,"file":"index.mjs","sources":["../src/hooks.ts","../../../node_modules/.pnpm/@context-query+core@0.3.0-beta.1/node_modules/@context-query/core/dist/index.mjs","../src/provider.tsx","../src/context.ts","../src/index.ts"],"sourcesContent":["import { TStateImpl } from \"@context-query/core\";\nimport { useCallback, useContext, useEffect, useState } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createUseContextQuery<TState extends TStateImpl>(\n contexts: ReturnType<typeof createStoreContext<TState>>\n) {\n const useStore = () => {\n const store = useContext(contexts);\n\n if (!store) {\n throw new Error(\n \"useContextQuery must be used within a ContextQueryProvider\"\n );\n }\n\n return store;\n };\n\n return <TKey extends keyof TState>(keys?: TKey[]) => {\n const store = useStore();\n const localKeys = keys ?? (Object.keys(store.getState()) as TKey[]);\n\n type StateSubset = { [K in TKey]: TState[K] };\n\n const getStateSubset = (): StateSubset => {\n return localKeys.reduce(\n (acc, key) => ({ ...acc, [key]: store.getStateByKey(key) }),\n {} as StateSubset\n );\n };\n\n const [state, setLocalState] = useState<StateSubset>(getStateSubset);\n\n useEffect(() => {\n const handleChange = (key: TKey, newValue: TState[TKey]) => {\n setLocalState((prev) => ({ ...prev, [key]: newValue }));\n };\n\n const subscriptions = localKeys.map((key) =>\n store.subscribe(key, handleChange)\n );\n\n return () => {\n subscriptions.forEach((sub) => sub.unsubscribe());\n };\n }, [localKeys, store]);\n\n const setState = useCallback(\n (value: StateSubset | ((prev: StateSubset) => StateSubset)) => {\n const currentValue = getStateSubset();\n const updatedValue =\n typeof value === \"function\"\n ? (value as Function)(currentValue)\n : value;\n\n Object.entries(updatedValue).forEach(([k, v]) => {\n store.setState(k as TKey, v as TState[TKey]);\n });\n },\n [localKeys, store]\n );\n\n return [state, setState] as const;\n };\n}\n\nexport function createUseContextSetter<TState extends TStateImpl>(\n StoreContext: ReturnType<typeof createStoreContext<TState>>\n) {\n return () => {\n const store = useContext(StoreContext);\n \n if (!store) {\n throw new Error(\"useContextSetter must be used within a ContextQueryProvider\");\n }\n \n const setState = useCallback((updater: Partial<TState> | ((prev: TState) => Partial<TState>)) => {\n const currentState = store.getState();\n const newState = typeof updater === 'function' ? updater(currentState) : updater;\n \n Object.entries(newState).forEach(([key, value]) => {\n store.setState(key as keyof TState, value as TState[keyof TState]);\n });\n }, [store]);\n \n return setState;\n };\n}\n","class t{state;listeners;constructor(t){this.state=t,this.listeners=new Map}getState(){return this.state}getStateByKey(t){return this.state[t]}updateState(t){const s={...this.state};this.state={...t};Object.keys(t).forEach((t=>{Object.is(s[t],this.state[t])||this.notifyListeners(t)}))}setState(t,s){Object.is(this.state[t],s)||(this.state={...this.state,[t]:s},this.notifyListeners(t))}notifyListeners(t){const s=this.listeners.get(t);if(s){const e=this.state[t];s.forEach((t=>t(e)))}}subscribe(t,s){const e=e=>{s(t,e)};this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(e);return{unsubscribe:()=>{const s=this.listeners.get(t);s&&(s.delete(e),0===s.size&&this.listeners.delete(t))}}}}export{t as ContextQueryStore};\n//# sourceMappingURL=index.mjs.map\n","import { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { PropsWithChildren, useMemo } from \"react\";\nimport { createStoreContext } from \"./context\";\n\nexport function createReactContextQuery<TState extends TStateImpl>() {\n const StoreContext = createStoreContext<TState>();\n const ContextQueryProvider = function ContextQueryProvider({\n children,\n initialState,\n }: PropsWithChildren<TState>) {\n const store = useMemo(\n () => new ContextQueryStore<TState>(initialState),\n [initialState]\n );\n\n return (\n <StoreContext.Provider value={store}>{children}</StoreContext.Provider>\n );\n };\n\n return {\n ContextQueryProvider,\n StoreContext,\n };\n}\n","import type { ContextQueryStore, TStateImpl } from \"@context-query/core\";\nimport { createContext } from \"react\";\n\nexport const createStoreContext = <TState extends TStateImpl>() => {\n return createContext<ContextQueryStore<TState> | null>(null);\n};\n","import { TStateImpl } from \"@context-query/core\";\nimport { createUseContextQuery, createUseContextSetter } from \"./hooks\";\nimport { createReactContextQuery } from \"./provider\";\n\nexport function createContextQuery<TState extends TStateImpl>() {\n const { ContextQueryProvider, StoreContext } =\n createReactContextQuery<TState>();\n const useContextQuery = createUseContextQuery<TState>(StoreContext);\n const useContextSetter = createUseContextSetter<TState>(StoreContext);\n return {\n ContextQueryProvider,\n useContextQuery,\n useContextSetter,\n };\n}\n"],"names":["createUseContextQuery","contexts","keys","store","useContext","Error","useStore","localKeys","Object","getState","getStateSubset","reduce","acc","key","getStateByKey","state","setLocalState","useState","useEffect","handleChange","newValue","prev","subscriptions","map","subscribe","forEach","sub","unsubscribe","useCallback","value","currentValue","updatedValue","entries","k","v","setState","t","listeners","constructor","this","Map","updateState","s","is","notifyListeners","get","e","has","set","Set","add","delete","size","createReactContextQuery","StoreContext","createContext","ContextQueryProvider","children","initialState","useMemo","ContextQueryStore","_jsx","Provider","createContextQuery","useContextQuery","useContextSetter","updater","currentState","newState","createUseContextSetter"],"mappings":"yJAIM,SAAUA,EACdC,GAcA,OAAmCC,IACjC,MAAMC,EAbS,MACf,MAAMA,EAAQC,EAAWH,GAEzB,IAAKE,EACH,MAAM,IAAIE,MACR,8DAIJ,OAAOF,CAAK,EAIEG,GACRC,EAAYL,GAASM,OAAON,KAAKC,EAAMM,YAIvCC,EAAiB,IACdH,EAAUI,QACf,CAACC,EAAKC,KAAS,IAAKD,EAAKC,CAACA,GAAMV,EAAMW,cAAcD,MACpD,CAAA,IAIGE,EAAOC,GAAiBC,EAAsBP,GAErDQ,GAAU,KACR,MAAMC,EAAe,CAACN,EAAWO,KAC/BJ,GAAeK,QAAeA,EAAMR,CAACA,GAAMO,KAAY,EAGnDE,EAAgBf,EAAUgB,KAAKV,GACnCV,EAAMqB,UAAUX,EAAKM,KAGvB,MAAO,KACLG,EAAcG,SAASC,GAAQA,EAAIC,eAAc,CAClD,GACA,CAACpB,EAAWJ,IAiBf,MAAO,CAACY,EAfSa,GACdC,IACC,MAAMC,EAAepB,IACfqB,EACa,mBAAVF,EACFA,E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b,KAAKF,UAAUc,OAAOf,GAAG,EAAE,WCIvrBiB,IACd,MAAMC,ECDCC,EAAgD,MDgBvD,MAAO,CACLC,qBAf2B,UAA8BC,SACzDA,EAAQC,aACRA,IAEA,MAAMvD,EAAQwD,GACZ,IAAM,IAAIC,EAA0BF,IACpC,CAACA,IAGH,OACEG,EAACP,EAAaQ,SAAQ,CAACjC,MAAO1B,EAAKsD,SAAGA,GAEzC,EAICH,eAEJ,UEpBgBS,IACd,MAAMP,qBAAEA,EAAoBF,aAAEA,GAC5BD,IACIW,EAAkBhE,EAA8BsD,GAChDW,EJ2DF,SACJX,GAEA,MAAO,KACL,MAAMnD,EAAQC,EAAWkD,GAEzB,IAAKnD,EACH,MAAM,IAAIE,MAAM,+DAYlB,OATiBuB,GAAasC,IAC5B,MAAMC,EAAehE,EAAMM,WACrB2D,EAA8B,mBAAZF,EAAyBA,EAAQC,GAAgBD,EAEzE1D,OAAOwB,QAAQoC,GAAU3C,SAAQ,EAAEZ,EAAKgB,MACtC1B,EAAMgC,SAAStB,EAAqBgB,EAA8B,GAClE,GACD,CAAC1B,GAEW,CAEnB,CIhF2BkE,CAA+Bf,GACxD,MAAO,CACLE,uBACAQ,kBACAC,mBAEJ","x_google_ignoreList":[1]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@context-query/react",
3
- "version": "0.3.0-beta.1",
3
+ "version": "0.3.1",
4
4
  "license": "MIT",
5
5
  "description": "React bindings for ContextQuery",
6
6
  "author": "Minyeoung Seo <tjalsdud89@naver.com>",