@rivetkit/framework-base 2.0.29-rc.1 → 2.0.29
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/mod.cjs +1 -1
- package/dist/mod.js +139 -111
- package/package.json +2 -2
package/dist/mod.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=new WeakMap,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=new WeakMap,_=new WeakMap,V={current:[]};let m=!1;const v=new Set,k=new Map;function O(i){const n=Array.from(i).sort((t,e)=>t instanceof h&&t.options.deps.includes(e)?1:e instanceof h&&e.options.deps.includes(t)?-1:0);for(const t of n){if(V.current.includes(t))continue;V.current.push(t),t.recompute();const e=_.get(t);if(e)for(const s of e){const r=p.get(s);r&&O(r)}}}function F(i){i.listeners.forEach(n=>n({prevVal:i.prevState,currentVal:i.state}))}function R(i){i.listeners.forEach(n=>n({prevVal:i.prevState,currentVal:i.state}))}function G(i){if(v.add(i),!m)try{for(m=!0;v.size>0;){const n=Array.from(v);v.clear();for(const t of n){const e=k.get(t)??t.prevState;t.prevState=e,F(t)}for(const t of n){const e=p.get(t);e&&(V.current.push(t),O(e))}for(const t of n){const e=p.get(t);if(e)for(const s of e)R(s)}}}finally{m=!1,V.current=[],k.clear()}}function I(i){return typeof i=="function"}class y{constructor(n,t){this.listeners=new Set,this.subscribe=e=>{var s,r;this.listeners.add(e);const d=(r=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:r.call(s,e,this);return()=>{this.listeners.delete(e),d==null||d()}},this.prevState=n,this.state=n,this.options=t}setState(n){var t,e,s;this.prevState=this.state,(t=this.options)!=null&&t.updateFn?this.state=this.options.updateFn(this.prevState)(n):I(n)?this.state=n(this.prevState):this.state=n,(s=(e=this.options)==null?void 0:e.onUpdate)==null||s.call(e),G(this)}}class h{constructor(n){this.listeners=new Set,this._subscriptions=[],this.lastSeenDepValues=[],this.getDepVals=()=>{const t=[],e=[];for(const s of this.options.deps)t.push(s.prevState),e.push(s.state);return this.lastSeenDepValues=e,{prevDepVals:t,currDepVals:e,prevVal:this.prevState??void 0}},this.recompute=()=>{var t,e;this.prevState=this.state;const{prevDepVals:s,currDepVals:r,prevVal:d}=this.getDepVals();this.state=this.options.fn({prevDepVals:s,currDepVals:r,prevVal:d}),(e=(t=this.options).onUpdate)==null||e.call(t)},this.checkIfRecalculationNeededDeeply=()=>{for(const r of this.options.deps)r instanceof h&&r.checkIfRecalculationNeededDeeply();let t=!1;const e=this.lastSeenDepValues,{currDepVals:s}=this.getDepVals();for(let r=0;r<s.length;r++)if(s[r]!==e[r]){t=!0;break}t&&this.recompute()},this.mount=()=>(this.registerOnGraph(),this.checkIfRecalculationNeededDeeply(),()=>{this.unregisterFromGraph();for(const t of this._subscriptions)t()}),this.subscribe=t=>{var e,s;this.listeners.add(t);const r=(s=(e=this.options).onSubscribe)==null?void 0:s.call(e,t,this);return()=>{this.listeners.delete(t),r==null||r()}},this.options=n,this.state=n.fn({prevDepVals:void 0,prevVal:void 0,currDepVals:this.getDepVals().currDepVals})}registerOnGraph(n=this.options.deps){for(const t of n)if(t instanceof h)t.registerOnGraph(),this.registerOnGraph(t.options.deps);else if(t instanceof y){let e=p.get(t);e||(e=new Set,p.set(t,e)),e.add(this);let s=_.get(this);s||(s=new Set,_.set(this,s)),s.add(t)}}unregisterFromGraph(n=this.options.deps){for(const t of n)if(t instanceof h)this.unregisterFromGraph(t.options.deps);else if(t instanceof y){const e=p.get(t);e&&e.delete(this);const s=_.get(this);s&&s.delete(t)}}}class N{constructor(n){const{eager:t,fn:e,...s}=n;this._derived=new h({...s,fn:()=>{},onUpdate(){e()}}),t&&e()}mount(){return this._derived.mount()}}function T(i,n={}){const t=new y({actors:{}}),e=n.hashFunction||A,s=new Map;function r(d){const o=e(d),D=s.get(o);if(D)return{...D,state:D.state};const g=new h({fn:({currDepVals:[a]})=>a.actors[o],deps:[t]});function b(){async function a(){const c=t.state.actors[o];try{const f=i.getOrCreate(c.opts.name,c.opts.key,{params:c.opts.params,createInRegion:c.opts.createInRegion,createWithInput:c.opts.createWithInput}),u=f.connect();u.onOpen(()=>{t.setState(l=>{var S;return((S=l.actors[o])==null?void 0:S.connection)!==u?l:{...l,actors:{...l.actors,[o]:{...l.actors[o],isConnected:!0}}}})}),u.onClose(()=>{t.setState(l=>{var S;return((S=l.actors[o])==null?void 0:S.connection)!==u?l:{...l,actors:{...l.actors,[o]:{...l.actors[o],isConnected:!1}}}})}),await f.resolve(),t.setState(l=>({...l,actors:{...l.actors,[o]:{...l.actors[o],isConnected:u.isConnected,isConnecting:!1,handle:f,connection:u,isError:!1,error:null}}}))}catch(f){t.setState(u=>({...u,actors:{...u.actors,[o]:{...u.actors[o],isError:!0,isConnecting:!1,error:f}}}))}}t.setState(c=>(c.actors[o].isConnecting=!0,c.actors[o].isError=!1,c.actors[o].error=null,a(),c))}const E=new N({fn:()=>{const a=t.state.actors[o];JSON.stringify(t.prevState.actors[o].opts)===JSON.stringify(t.state.actors[o].opts)&&!a.isConnected&&!a.isConnecting&&!a.isError&&a.opts.enabled&&b()},deps:[g]});t.setState(a=>a.actors[o]?a:{...a,actors:{...a.actors,[o]:{hash:o,isConnected:!1,isConnecting:!1,connection:null,handle:null,isError:!1,error:null,opts:d}}});function w(a){t.setState(c=>{const f=c.actors[o];if(!f)throw new Error(`Actor with key "${o}" does not exist.`);let u;return typeof a=="function"?u=a(f):u=a,{...c,actors:{...c.actors,[o]:u}}})}const C=()=>{const a=g.mount(),c=E.mount();return()=>{a(),c()}};return s.set(o,{state:g,key:o,mount:C,setState:w,create:b}),{mount:C,setState:w,state:g,create:b,key:o}}return{getOrCreateActor:r,store:t}}function A({name:i,key:n,params:t}){return JSON.stringify({name:i,key:n,params:t})}exports.createRivetKit=T;
|
package/dist/mod.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const
|
|
1
|
+
const d = /* @__PURE__ */ new WeakMap(), _ = /* @__PURE__ */ new WeakMap(), V = {
|
|
2
2
|
current: []
|
|
3
3
|
};
|
|
4
|
-
let
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
const n = Array.from(i).sort((t, e) => t instanceof
|
|
4
|
+
let m = !1;
|
|
5
|
+
const v = /* @__PURE__ */ new Set(), k = /* @__PURE__ */ new Map();
|
|
6
|
+
function E(i) {
|
|
7
|
+
const n = Array.from(i).sort((t, e) => t instanceof h && t.options.deps.includes(e) ? 1 : e instanceof h && e.options.deps.includes(t) ? -1 : 0);
|
|
8
8
|
for (const t of n) {
|
|
9
|
-
if (
|
|
9
|
+
if (V.current.includes(t))
|
|
10
10
|
continue;
|
|
11
|
-
|
|
12
|
-
const e =
|
|
11
|
+
V.current.push(t), t.recompute();
|
|
12
|
+
const e = _.get(t);
|
|
13
13
|
if (e)
|
|
14
14
|
for (const s of e) {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const r = d.get(s);
|
|
16
|
+
r && E(r);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -25,7 +25,7 @@ function F(i) {
|
|
|
25
25
|
})
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function G(i) {
|
|
29
29
|
i.listeners.forEach(
|
|
30
30
|
(n) => n({
|
|
31
31
|
prevVal: i.prevState,
|
|
@@ -33,51 +33,51 @@ function O(i) {
|
|
|
33
33
|
})
|
|
34
34
|
);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (
|
|
36
|
+
function I(i) {
|
|
37
|
+
if (v.add(i), !m)
|
|
38
38
|
try {
|
|
39
|
-
for (
|
|
40
|
-
const n = Array.from(
|
|
41
|
-
|
|
39
|
+
for (m = !0; v.size > 0; ) {
|
|
40
|
+
const n = Array.from(v);
|
|
41
|
+
v.clear();
|
|
42
42
|
for (const t of n) {
|
|
43
43
|
const e = k.get(t) ?? t.prevState;
|
|
44
44
|
t.prevState = e, F(t);
|
|
45
45
|
}
|
|
46
46
|
for (const t of n) {
|
|
47
|
-
const e =
|
|
48
|
-
e && (
|
|
47
|
+
const e = d.get(t);
|
|
48
|
+
e && (V.current.push(t), E(e));
|
|
49
49
|
}
|
|
50
50
|
for (const t of n) {
|
|
51
|
-
const e =
|
|
51
|
+
const e = d.get(t);
|
|
52
52
|
if (e)
|
|
53
53
|
for (const s of e)
|
|
54
|
-
|
|
54
|
+
G(s);
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
} finally {
|
|
58
|
-
|
|
58
|
+
m = !1, V.current = [], k.clear();
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function R(i) {
|
|
62
62
|
return typeof i == "function";
|
|
63
63
|
}
|
|
64
|
-
class
|
|
64
|
+
class w {
|
|
65
65
|
constructor(n, t) {
|
|
66
66
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = (e) => {
|
|
67
|
-
var s,
|
|
67
|
+
var s, r;
|
|
68
68
|
this.listeners.add(e);
|
|
69
|
-
const
|
|
69
|
+
const p = (r = (s = this.options) == null ? void 0 : s.onSubscribe) == null ? void 0 : r.call(s, e, this);
|
|
70
70
|
return () => {
|
|
71
|
-
this.listeners.delete(e),
|
|
71
|
+
this.listeners.delete(e), p == null || p();
|
|
72
72
|
};
|
|
73
73
|
}, this.prevState = n, this.state = n, this.options = t;
|
|
74
74
|
}
|
|
75
75
|
setState(n) {
|
|
76
76
|
var t, e, s;
|
|
77
|
-
this.prevState = this.state, (t = this.options) != null && t.updateFn ? this.state = this.options.updateFn(this.prevState)(n) :
|
|
77
|
+
this.prevState = this.state, (t = this.options) != null && t.updateFn ? this.state = this.options.updateFn(this.prevState)(n) : R(n) ? this.state = n(this.prevState) : this.state = n, (s = (e = this.options) == null ? void 0 : e.onUpdate) == null || s.call(e), I(this);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
class
|
|
80
|
+
class h {
|
|
81
81
|
constructor(n) {
|
|
82
82
|
this.listeners = /* @__PURE__ */ new Set(), this._subscriptions = [], this.lastSeenDepValues = [], this.getDepVals = () => {
|
|
83
83
|
const t = [], e = [];
|
|
@@ -91,19 +91,19 @@ class f {
|
|
|
91
91
|
}, this.recompute = () => {
|
|
92
92
|
var t, e;
|
|
93
93
|
this.prevState = this.state;
|
|
94
|
-
const { prevDepVals: s, currDepVals:
|
|
94
|
+
const { prevDepVals: s, currDepVals: r, prevVal: p } = this.getDepVals();
|
|
95
95
|
this.state = this.options.fn({
|
|
96
96
|
prevDepVals: s,
|
|
97
|
-
currDepVals:
|
|
98
|
-
prevVal:
|
|
97
|
+
currDepVals: r,
|
|
98
|
+
prevVal: p
|
|
99
99
|
}), (e = (t = this.options).onUpdate) == null || e.call(t);
|
|
100
100
|
}, this.checkIfRecalculationNeededDeeply = () => {
|
|
101
|
-
for (const
|
|
102
|
-
|
|
101
|
+
for (const r of this.options.deps)
|
|
102
|
+
r instanceof h && r.checkIfRecalculationNeededDeeply();
|
|
103
103
|
let t = !1;
|
|
104
104
|
const e = this.lastSeenDepValues, { currDepVals: s } = this.getDepVals();
|
|
105
|
-
for (let
|
|
106
|
-
if (s[
|
|
105
|
+
for (let r = 0; r < s.length; r++)
|
|
106
|
+
if (s[r] !== e[r]) {
|
|
107
107
|
t = !0;
|
|
108
108
|
break;
|
|
109
109
|
}
|
|
@@ -115,9 +115,9 @@ class f {
|
|
|
115
115
|
}), this.subscribe = (t) => {
|
|
116
116
|
var e, s;
|
|
117
117
|
this.listeners.add(t);
|
|
118
|
-
const
|
|
118
|
+
const r = (s = (e = this.options).onSubscribe) == null ? void 0 : s.call(e, t, this);
|
|
119
119
|
return () => {
|
|
120
|
-
this.listeners.delete(t),
|
|
120
|
+
this.listeners.delete(t), r == null || r();
|
|
121
121
|
};
|
|
122
122
|
}, this.options = n, this.state = n.fn({
|
|
123
123
|
prevDepVals: void 0,
|
|
@@ -127,31 +127,31 @@ class f {
|
|
|
127
127
|
}
|
|
128
128
|
registerOnGraph(n = this.options.deps) {
|
|
129
129
|
for (const t of n)
|
|
130
|
-
if (t instanceof
|
|
130
|
+
if (t instanceof h)
|
|
131
131
|
t.registerOnGraph(), this.registerOnGraph(t.options.deps);
|
|
132
|
-
else if (t instanceof
|
|
133
|
-
let e =
|
|
134
|
-
e || (e = /* @__PURE__ */ new Set(),
|
|
135
|
-
let s =
|
|
136
|
-
s || (s = /* @__PURE__ */ new Set(),
|
|
132
|
+
else if (t instanceof w) {
|
|
133
|
+
let e = d.get(t);
|
|
134
|
+
e || (e = /* @__PURE__ */ new Set(), d.set(t, e)), e.add(this);
|
|
135
|
+
let s = _.get(this);
|
|
136
|
+
s || (s = /* @__PURE__ */ new Set(), _.set(this, s)), s.add(t);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
unregisterFromGraph(n = this.options.deps) {
|
|
140
140
|
for (const t of n)
|
|
141
|
-
if (t instanceof
|
|
141
|
+
if (t instanceof h)
|
|
142
142
|
this.unregisterFromGraph(t.options.deps);
|
|
143
|
-
else if (t instanceof
|
|
144
|
-
const e =
|
|
143
|
+
else if (t instanceof w) {
|
|
144
|
+
const e = d.get(t);
|
|
145
145
|
e && e.delete(this);
|
|
146
|
-
const s =
|
|
146
|
+
const s = _.get(this);
|
|
147
147
|
s && s.delete(t);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class N {
|
|
152
152
|
constructor(n) {
|
|
153
153
|
const { eager: t, fn: e, ...s } = n;
|
|
154
|
-
this._derived = new
|
|
154
|
+
this._derived = new h({
|
|
155
155
|
...s,
|
|
156
156
|
fn: () => {
|
|
157
157
|
},
|
|
@@ -164,26 +164,26 @@ class R {
|
|
|
164
164
|
return this._derived.mount();
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
const t = new
|
|
167
|
+
function L(i, n = {}) {
|
|
168
|
+
const t = new w({
|
|
169
169
|
actors: {}
|
|
170
|
-
}), e = n.hashFunction ||
|
|
171
|
-
function
|
|
172
|
-
const
|
|
173
|
-
if (
|
|
170
|
+
}), e = n.hashFunction || A, s = /* @__PURE__ */ new Map();
|
|
171
|
+
function r(p) {
|
|
172
|
+
const o = e(p), D = s.get(o);
|
|
173
|
+
if (D)
|
|
174
174
|
return {
|
|
175
|
-
...
|
|
176
|
-
state:
|
|
175
|
+
...D,
|
|
176
|
+
state: D.state
|
|
177
177
|
};
|
|
178
|
-
const
|
|
179
|
-
fn: ({ currDepVals: [a] }) => a.actors[
|
|
178
|
+
const g = new h({
|
|
179
|
+
fn: ({ currDepVals: [a] }) => a.actors[o],
|
|
180
180
|
deps: [t]
|
|
181
181
|
});
|
|
182
|
-
function
|
|
182
|
+
function b() {
|
|
183
183
|
async function a() {
|
|
184
|
-
const c = t.state.actors[
|
|
184
|
+
const c = t.state.actors[o];
|
|
185
185
|
try {
|
|
186
|
-
const
|
|
186
|
+
const f = i.getOrCreate(
|
|
187
187
|
c.opts.name,
|
|
188
188
|
c.opts.key,
|
|
189
189
|
{
|
|
@@ -191,107 +191,135 @@ function A(i, n = {}) {
|
|
|
191
191
|
createInRegion: c.opts.createInRegion,
|
|
192
192
|
createWithInput: c.opts.createWithInput
|
|
193
193
|
}
|
|
194
|
-
),
|
|
195
|
-
|
|
194
|
+
), u = f.connect();
|
|
195
|
+
u.onOpen(() => {
|
|
196
|
+
t.setState((l) => {
|
|
197
|
+
var S;
|
|
198
|
+
return ((S = l.actors[o]) == null ? void 0 : S.connection) !== u ? l : {
|
|
199
|
+
...l,
|
|
200
|
+
actors: {
|
|
201
|
+
...l.actors,
|
|
202
|
+
[o]: {
|
|
203
|
+
...l.actors[o],
|
|
204
|
+
isConnected: !0
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
}), u.onClose(() => {
|
|
210
|
+
t.setState((l) => {
|
|
211
|
+
var S;
|
|
212
|
+
return ((S = l.actors[o]) == null ? void 0 : S.connection) !== u ? l : {
|
|
213
|
+
...l,
|
|
214
|
+
actors: {
|
|
215
|
+
...l.actors,
|
|
216
|
+
[o]: {
|
|
217
|
+
...l.actors[o],
|
|
218
|
+
isConnected: !1
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
});
|
|
223
|
+
}), await f.resolve(
|
|
196
224
|
/*{ signal: AbortSignal.timeout(0) }*/
|
|
197
|
-
), t.setState((
|
|
198
|
-
...
|
|
225
|
+
), t.setState((l) => ({
|
|
226
|
+
...l,
|
|
199
227
|
actors: {
|
|
200
|
-
...
|
|
201
|
-
[
|
|
202
|
-
...
|
|
203
|
-
isConnected:
|
|
228
|
+
...l.actors,
|
|
229
|
+
[o]: {
|
|
230
|
+
...l.actors[o],
|
|
231
|
+
isConnected: u.isConnected,
|
|
204
232
|
isConnecting: !1,
|
|
205
|
-
handle:
|
|
206
|
-
connection:
|
|
233
|
+
handle: f,
|
|
234
|
+
connection: u,
|
|
207
235
|
isError: !1,
|
|
208
236
|
error: null
|
|
209
237
|
}
|
|
210
238
|
}
|
|
211
239
|
}));
|
|
212
|
-
} catch (
|
|
213
|
-
t.setState((
|
|
214
|
-
...
|
|
240
|
+
} catch (f) {
|
|
241
|
+
t.setState((u) => ({
|
|
242
|
+
...u,
|
|
215
243
|
actors: {
|
|
216
|
-
...
|
|
217
|
-
[
|
|
218
|
-
...
|
|
244
|
+
...u.actors,
|
|
245
|
+
[o]: {
|
|
246
|
+
...u.actors[o],
|
|
219
247
|
isError: !0,
|
|
220
248
|
isConnecting: !1,
|
|
221
|
-
error:
|
|
249
|
+
error: f
|
|
222
250
|
}
|
|
223
251
|
}
|
|
224
252
|
}));
|
|
225
253
|
}
|
|
226
254
|
}
|
|
227
|
-
t.setState((c) => (c.actors[
|
|
255
|
+
t.setState((c) => (c.actors[o].isConnecting = !0, c.actors[o].isError = !1, c.actors[o].error = null, a(), c));
|
|
228
256
|
}
|
|
229
|
-
const
|
|
257
|
+
const O = new N({
|
|
230
258
|
fn: () => {
|
|
231
|
-
const a = t.state.actors[
|
|
232
|
-
JSON.stringify(t.prevState.actors[
|
|
259
|
+
const a = t.state.actors[o];
|
|
260
|
+
JSON.stringify(t.prevState.actors[o].opts) === JSON.stringify(t.state.actors[o].opts) && !a.isConnected && !a.isConnecting && !a.isError && a.opts.enabled && b();
|
|
233
261
|
},
|
|
234
|
-
deps: [
|
|
262
|
+
deps: [g]
|
|
235
263
|
});
|
|
236
|
-
t.setState((a) => a.actors[
|
|
264
|
+
t.setState((a) => a.actors[o] ? a : {
|
|
237
265
|
...a,
|
|
238
266
|
actors: {
|
|
239
267
|
...a.actors,
|
|
240
|
-
[
|
|
241
|
-
hash:
|
|
268
|
+
[o]: {
|
|
269
|
+
hash: o,
|
|
242
270
|
isConnected: !1,
|
|
243
271
|
isConnecting: !1,
|
|
244
272
|
connection: null,
|
|
245
273
|
handle: null,
|
|
246
274
|
isError: !1,
|
|
247
275
|
error: null,
|
|
248
|
-
opts:
|
|
276
|
+
opts: p
|
|
249
277
|
}
|
|
250
278
|
}
|
|
251
279
|
});
|
|
252
|
-
function
|
|
280
|
+
function y(a) {
|
|
253
281
|
t.setState((c) => {
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
256
|
-
throw new Error(`Actor with key "${
|
|
257
|
-
let
|
|
258
|
-
return typeof a == "function" ?
|
|
282
|
+
const f = c.actors[o];
|
|
283
|
+
if (!f)
|
|
284
|
+
throw new Error(`Actor with key "${o}" does not exist.`);
|
|
285
|
+
let u;
|
|
286
|
+
return typeof a == "function" ? u = a(f) : u = a, {
|
|
259
287
|
...c,
|
|
260
288
|
actors: {
|
|
261
289
|
...c.actors,
|
|
262
|
-
[
|
|
290
|
+
[o]: u
|
|
263
291
|
}
|
|
264
292
|
};
|
|
265
293
|
});
|
|
266
294
|
}
|
|
267
|
-
const
|
|
268
|
-
const a =
|
|
295
|
+
const C = () => {
|
|
296
|
+
const a = g.mount(), c = O.mount();
|
|
269
297
|
return () => {
|
|
270
298
|
a(), c();
|
|
271
299
|
};
|
|
272
300
|
};
|
|
273
|
-
return s.set(
|
|
274
|
-
state:
|
|
275
|
-
key:
|
|
276
|
-
mount:
|
|
277
|
-
setState:
|
|
278
|
-
create:
|
|
301
|
+
return s.set(o, {
|
|
302
|
+
state: g,
|
|
303
|
+
key: o,
|
|
304
|
+
mount: C,
|
|
305
|
+
setState: y,
|
|
306
|
+
create: b
|
|
279
307
|
}), {
|
|
280
|
-
mount:
|
|
281
|
-
setState:
|
|
282
|
-
state:
|
|
283
|
-
create:
|
|
284
|
-
key:
|
|
308
|
+
mount: C,
|
|
309
|
+
setState: y,
|
|
310
|
+
state: g,
|
|
311
|
+
create: b,
|
|
312
|
+
key: o
|
|
285
313
|
};
|
|
286
314
|
}
|
|
287
315
|
return {
|
|
288
|
-
getOrCreateActor:
|
|
316
|
+
getOrCreateActor: r,
|
|
289
317
|
store: t
|
|
290
318
|
};
|
|
291
319
|
}
|
|
292
|
-
function
|
|
320
|
+
function A({ name: i, key: n, params: t }) {
|
|
293
321
|
return JSON.stringify({ name: i, key: n, params: t });
|
|
294
322
|
}
|
|
295
323
|
export {
|
|
296
|
-
|
|
324
|
+
L as createRivetKit
|
|
297
325
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/framework-base",
|
|
3
|
-
"version": "2.0.29
|
|
3
|
+
"version": "2.0.29",
|
|
4
4
|
"description": "Base framework utilities for RivetKit client integrations",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"stableVersion": "0.8.0",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@tanstack/store": "^0.7.1",
|
|
40
|
-
"rivetkit": "2.0.29
|
|
40
|
+
"rivetkit": "2.0.29"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
43
|
"dev": "vite build --watch",
|