@picked/react 0.0.67 → 0.0.68-next.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/feature.d.ts
CHANGED
|
@@ -21,5 +21,20 @@ export declare function useFeature(featureName: string): () => Promise<FeatureBu
|
|
|
21
21
|
* const result = useFeatureResult('my-feature')
|
|
22
22
|
*/
|
|
23
23
|
export declare function useFeatureResult(featureName: string): FeatureResult | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Returns a feature's admin `enabled` flag, reactive to store updates.
|
|
26
|
+
*
|
|
27
|
+
* Unlike {@link useFeature}, this reads the static config flag directly and does not
|
|
28
|
+
* trigger bucket resolution — so a disabled feature (`enabled: false`) can be told
|
|
29
|
+
* apart from an enabled feature whose session simply was not allocated. Returns
|
|
30
|
+
* `undefined` when the feature is unregistered or carries no `enabled` metadata
|
|
31
|
+
* (for example, manually-registered features).
|
|
32
|
+
*
|
|
33
|
+
* @param {string} featureName - The feature id to look up.
|
|
34
|
+
* @returns {boolean | undefined} The feature's `enabled` flag, or `undefined` when unknown.
|
|
35
|
+
* @example
|
|
36
|
+
* const enabled = useFeatureEnabled('winter-sale')
|
|
37
|
+
*/
|
|
38
|
+
export declare function useFeatureEnabled(featureName: string): boolean | undefined;
|
|
24
39
|
export {};
|
|
25
40
|
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../src/hooks/feature.ts"],"names":[],"mappings":"AAQA,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAEjD,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAgBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CA0C/E"}
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../src/hooks/feature.ts"],"names":[],"mappings":"AAQA,KAAK,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAEjD,UAAU,aAAa;IACrB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,OAAO,CAAA;CACzB;AAgBD;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,aAAa,CAAC,CAE5E;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CA0C/E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAI1E"}
|
package/dist/hooks/feature.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{usePicked as e}from"./client.js";import{useStoreGlobal as t}from"./use-store-global.js";import{attach as n,createEffect as r,createEvent as i,createStore as a,sample as o}from"effector";function s(t){return e().features.getEvokableFeature(t)}function c(e){return t(s(e))}function l(e){let c=s(e),l=a(void 0,{skipVoid:!1}),u=i(),d=n({source:c,mapParams:(e,t)=>t,effect:r(async e=>await e())});return o({clock:u,target:d}),o({clock:d.doneData,fn:t=>{if(t!==void 0)return{id:e,bucket:t}},target:l}),u(),o({clock:c,target:u}),t(l)}export{c as useFeature,l as useFeatureResult};
|
|
1
|
+
import{usePicked as e}from"./client.js";import{useStoreGlobal as t}from"./use-store-global.js";import{attach as n,createEffect as r,createEvent as i,createStore as a,sample as o}from"effector";function s(t){return e().features.getEvokableFeature(t)}function c(e){return t(s(e))}function l(e){let c=s(e),l=a(void 0,{skipVoid:!1}),u=i(),d=n({source:c,mapParams:(e,t)=>t,effect:r(async e=>await e())});return o({clock:u,target:d}),o({clock:d.doneData,fn:t=>{if(t!==void 0)return{id:e,bucket:t}},target:l}),u(),o({clock:c,target:u}),t(l)}function u(n){return t(e().features.getById(n))?.enabled}export{c as useFeature,u as useFeatureEnabled,l as useFeatureResult};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export type { StepContext } from './step';
|
|
|
9
9
|
export { useSessionStorage, useLocalStorage } from './storage';
|
|
10
10
|
export type { UseStorageOptions } from './storage';
|
|
11
11
|
export * from './field';
|
|
12
|
-
export { useFeature, useFeatureResult } from './feature';
|
|
12
|
+
export { useFeature, useFeatureResult, useFeatureEnabled } from './feature';
|
|
13
13
|
export { useAction, useActionResult } from './action';
|
|
14
14
|
export { useContent } from './content';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACjG,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACjG,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACnE,YAAY,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC9D,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAClD,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC3E,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ClientContext as e,ClientProvider as t,ExperienceContext as n,ExperienceProvider as r}from"../context.js";import{useExperience as i,usePicked as a}from"./client.js";import{useStoreGlobal as o}from"./use-store-global.js";import{useSetStepContext as s,useStep as c,useStepContent as l}from"./step.js";import{useLocalStorage as u,useSessionStorage as d}from"./storage.js";import{getField as f}from"./field.js";import{useFeature as p,useFeatureResult as
|
|
1
|
+
import{ClientContext as e,ClientProvider as t,ExperienceContext as n,ExperienceProvider as r}from"../context.js";import{useExperience as i,usePicked as a}from"./client.js";import{useStoreGlobal as o}from"./use-store-global.js";import{useSetStepContext as s,useStep as c,useStepContent as l}from"./step.js";import{useLocalStorage as u,useSessionStorage as d}from"./storage.js";import{getField as f}from"./field.js";import{useFeature as p,useFeatureEnabled as m,useFeatureResult as h}from"./feature.js";import{useAction as g,useActionResult as _}from"./action.js";import{useContent as v}from"./content.js";export{e as ClientContext,t as ClientProvider,n as ExperienceContext,r as ExperienceProvider,f as getField,g as useAction,_ as useActionResult,v as useContent,i as useExperience,p as useFeature,m as useFeatureEnabled,h as useFeatureResult,u as useLocalStorage,a as usePicked,d as useSessionStorage,s as useSetStepContext,c as useStep,l as useStepContent,o as useStoreGlobal};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.68-next.1",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"@picked/client": "workspace:*",
|
|
6
6
|
"@repo/eslint-config": "workspace:*",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
},
|
|
86
86
|
"module": "./dist/index.js",
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@picked/client": "0.0.
|
|
88
|
+
"@picked/client": "0.0.68-next.1",
|
|
89
89
|
"effector": "^23.3.0",
|
|
90
90
|
"react": "19.2.2",
|
|
91
91
|
"react-dom": "19.2.2"
|