@picked/svelte 0.0.51-next.6 → 0.0.51-next.8
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/action.d.ts +25 -2
- package/dist/hooks/action.js +1 -1
- package/package.json +2 -2
package/dist/hooks/action.d.ts
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { Action } from '@picked/client';
|
|
2
|
+
import { Store } from 'effector';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the reactive evokable action store for the given action name.
|
|
5
|
+
*
|
|
6
|
+
* @param {string} actionName - The registered action name.
|
|
7
|
+
* @returns {Store<() => ReturnType<Action>>} A store containing the callable action function or undefined.
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* const actionStore = getAction('logEvent')
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export declare function getAction(actionName: string): Store<() => ReturnType<Action>>;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a reactive store holding the latest result of invoking the named action.
|
|
16
|
+
* Re-evaluates automatically when the underlying action store updates.
|
|
17
|
+
*
|
|
18
|
+
* @param {string} actionName - The registered action name.
|
|
19
|
+
* @returns {Store<string | string[] | boolean | void | undefined>} A store containing the latest action return value.
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const result = getActionResult('isLoggedIn')
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function getActionResult(actionName: string): import('effector').StoreWritable<string | boolean | void | string[] | undefined>;
|
package/dist/hooks/action.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPicked as e}from"./client.js";import{attach as t,createEffect as n,createEvent as r,createStore as i,sample as a}from"effector";function o(t){return e().actions.getEvokableAction(t)}function s(e){let s=o(e),c=i(void 0,{skipVoid:!1}),l=r(),u=t({source:s,mapParams:(e,t)=>t,effect:n(async e=>{if(e)return e()})});return a({clock:l,target:u}),a({clock:u.doneData,target:c}),l(),c}export{o as getAction,s as getActionResult};
|
|
1
|
+
import{getPicked as e}from"./client.js";import{attach as t,createEffect as n,createEvent as r,createStore as i,sample as a}from"effector";import"@picked/client";function o(t){return e().actions.getEvokableAction(t)}function s(e){let s=o(e),c=i(void 0,{skipVoid:!1}),l=r(),u=t({source:s,mapParams:(e,t)=>t,effect:n(async e=>{if(e)return await e()})});return a({clock:l,target:u}),a({clock:u.doneData,target:c}),l(),a({clock:s,target:l}),c}export{o as getAction,s as getActionResult};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/svelte",
|
|
3
|
-
"version": "0.0.51-next.
|
|
3
|
+
"version": "0.0.51-next.8",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"d3": "^7.9.0"
|
|
6
6
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
},
|
|
89
89
|
"module": "./dist/index.js",
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@picked/client": "0.0.51-next.
|
|
91
|
+
"@picked/client": "0.0.51-next.8",
|
|
92
92
|
"effector": "^23.3.0",
|
|
93
93
|
"svelte": "^5.46.4"
|
|
94
94
|
},
|