@devvit/public-api 0.11.0-next-2024-08-06-9a9058384.0 → 0.11.0-next-2024-08-06-2b2a01b37.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,26 @@ export declare function isRendering(): boolean;
17
17
  * See [HookSegment](./types.ts) for more information.
18
18
  */
19
19
  export declare function assertValidNamespace(input: string): void;
20
+ type RegisterHookOptions<H extends Hook> = HookSegment & {
21
+ /**
22
+ * Factory function to build the hook. Only called once for the entire lifecycle of a
23
+ * BlocksHandler.handle() invocation.
24
+ */
25
+ initializer: (p: HookParams) => H;
26
+ /**
27
+ * A lifecycle hook that gives you the living reference of the hook being used during render. This enables
28
+ * you to augment properties on the hook as BlocksHandler.handle() is processing events since the initializer
29
+ * is only called once.
30
+ *
31
+ * We require this as hooks are sometimes cached while evaluating events in BlocksHandler.handle(). The best
32
+ * use of this function is to ensure that your hooks contain up to date information if they have can have
33
+ * a relationship with a hook that is evaluated before it (see useAsync for an example).
34
+ */
35
+ refresh?: (hook: H) => void;
36
+ };
20
37
  /**
38
+ * This can get called multiple times in a given render. Initialize is only called once!
39
+ *
21
40
  * This is the recommended low-level interface for creating hooks like useState or useAsync.
22
41
  *
23
42
  * Practically, this initializes your hook if it doesn't already exist, and makes sure
@@ -28,7 +47,7 @@ export declare function assertValidNamespace(input: string): void;
28
47
  * factory for building this hook
29
48
  * @returns
30
49
  */
31
- export declare function registerHook<H extends Hook>(options: HookSegment, initializer: (p: HookParams) => H): H;
50
+ export declare function registerHook<H extends Hook>({ initializer, refresh, ...hookSegment }: RegisterHookOptions<H>): H;
32
51
  export declare let _latestBlocksHandler: BlocksHandler | null;
33
52
  /**
34
53
  * Replacing BlocksReconciler, the model is now less of a "reconciliation", and more
@@ -41,4 +60,5 @@ export declare class BlocksHandler {
41
60
  constructor(root: JSX.ComponentFunction);
42
61
  handle(request: UIRequest, metadata: Metadata): Promise<UIResponse>;
43
62
  }
63
+ export {};
44
64
  //# sourceMappingURL=BlocksHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlocksHandler.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/BlocksHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAe,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAgB,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,KAAK,EAAe,IAAI,EAAE,UAAU,EAAE,WAAW,EAAS,MAAM,YAAY,CAAC;AAIpF;;;;;;GAMG;AACH,eAAO,IAAI,oBAAoB,EAAE,aAAa,GAAG,IAAW,CAAC;AAE7D,wBAAgB,gBAAgB,IAAI,aAAa,CAKhD;AAED,wBAAgB,WAAW,IAAI,OAAO,CAErC;AAMD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CASxD;AASD;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,IAAI,EACzC,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,CAAC,GAChC,CAAC,CAkCH;AAED,eAAO,IAAI,oBAAoB,EAAE,aAAa,GAAG,IAAW,CAAC;AAE7D;;;;GAIG;AACH,qBAAa,aAAa;;IAMxB,oBAAoB,EAAE,aAAa,GAAG,IAAI,CAAQ;gBAEtC,IAAI,EAAE,GAAG,CAAC,iBAAiB;IAMjC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC;CAoX1E"}
1
+ {"version":3,"file":"BlocksHandler.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/BlocksHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,UAAU,EA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function shouldFireAttemptHookWarning(event) {
52
52
  return !event.hook;
53
53
  }
54
54
  /**
55
+ * This can get called multiple times in a given render. Initialize is only called once!
56
+ *
55
57
  * This is the recommended low-level interface for creating hooks like useState or useAsync.
56
58
  *
57
59
  * Practically, this initializes your hook if it doesn't already exist, and makes sure
@@ -62,12 +64,12 @@ function shouldFireAttemptHookWarning(event) {
62
64
  * factory for building this hook
63
65
  * @returns
64
66
  */
65
- export function registerHook(options, initializer) {
67
+ export function registerHook({ initializer, refresh, ...hookSegment }) {
66
68
  if (!_activeRenderContext) {
67
69
  throw new Error("Hooks can only be declared at the top of a component. You cannot declare hooks outside of components or inside of event handlers. It's almost always a mistake to declare hooks inside of loops or conditionals.");
68
70
  }
69
- assertValidNamespace(options.namespace);
70
- const hookId = _activeRenderContext.nextHookId(options);
71
+ assertValidNamespace(hookSegment.namespace);
72
+ const hookId = _activeRenderContext.nextHookId(hookSegment);
71
73
  const context = _activeRenderContext;
72
74
  context._touched[hookId] = true;
73
75
  const params = {
@@ -82,6 +84,13 @@ export function registerHook(options, initializer) {
82
84
  _isTombstone(_activeRenderContext._state[hookId]);
83
85
  _activeRenderContext._hooks[hookId] = _activeRenderContext._hooks[hookId] ?? initializer(params);
84
86
  const hook = _activeRenderContext._hooks[hookId];
87
+ /**
88
+ * We now cache hooks sometimes during the lifecycle of a request. However,
89
+ * certain hooks (useAsync) needs the latest information to make sure it works correctly
90
+ * refresh gives callers the living reference as a parameter so that they can
91
+ * mutate it as they see fit.
92
+ */
93
+ refresh?.(hook);
85
94
  if (!fromNull) {
86
95
  hook.state = _activeRenderContext._state[hookId];
87
96
  }
@@ -409,11 +418,12 @@ async function _BlocksHandler_handleAsyncQueues(context, ...batch) {
409
418
  const hook = registerHook({
410
419
  namespace: key,
411
420
  key: false,
412
- }, ({ hookId }) => ({
413
- hookId,
414
- state: null,
415
- onUIEvent: (event) => props[key](event.userAction?.data),
416
- }));
421
+ initializer: ({ hookId }) => ({
422
+ hookId,
423
+ state: null,
424
+ onUIEvent: (event) => props[key](event.userAction?.data),
425
+ }),
426
+ });
417
427
  reifiedProps[key] = hook.hookId;
418
428
  if ('captureHookRef' in props[key]) {
419
429
  props[key].captureHookRef();
@@ -33,7 +33,18 @@ export declare class RenderContext implements EffectEmitter {
33
33
  * reuse it.
34
34
  */
35
35
  _latestRenderContent: ReifiedBlockElement | undefined;
36
- /** Has this state been mutated since initially loaded? */
36
+ /**
37
+ * Has this state been mutated since initially loaded?
38
+ *
39
+ * _changed is used to determine the state deltas to report in the response
40
+ * of the handle function inside of BlocksHandler. It's very important
41
+ * that this list contains a comprehensive list of all hooks that have
42
+ * changed during the entire invocation of BlocksHandler.handle.
43
+ *
44
+ * It may be tempting to clear the state deltas on every iteration via the
45
+ * loop, but in doing so you'll create many roundtrips from the client to
46
+ * the runtime resulting in the UI flickering.
47
+ */
37
48
  _changed: {
38
49
  [hookID: string]: true;
39
50
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RenderContext.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/RenderContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAelE;;;;;;;;;GASG;AACH,qBAAa,aAAc,YAAW,aAAa;;IACjD,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAElC,SAA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** Has this state been mutated since initially loaded? */
43
+ /**
44
+ * Has this state been mutated since initially loaded?
45
+ *
46
+ * _changed is used to determine the state deltas to report in the response
47
+ * of the handle function inside of BlocksHandler. It's very important
48
+ * that this list contains a comprehensive list of all hooks that have
49
+ * changed during the entire invocation of BlocksHandler.handle.
50
+ *
51
+ * It may be tempting to clear the state deltas on every iteration via the
52
+ * loop, but in doing so you'll create many roundtrips from the client to
53
+ * the runtime resulting in the UI flickering.
54
+ */
44
55
  this._changed = {};
45
56
  /** Does this hook still exist in the most recent render? */
46
57
  this._touched = {};
@@ -89,7 +100,11 @@ export class RenderContext {
89
100
  }
90
101
  /** Replacing state resets the delta for the next render. */
91
102
  set _state(state) {
92
- this._changed = {};
103
+ // You may be tempted to put `this._changed = {}` here, please DON'T!
104
+ // There are many times we may choose to reset the state while processing
105
+ // events. Remember that the BlocksHandler can do N number of passes before
106
+ // it determines it is time to send a response back to the client. _changed
107
+ // needs to encompass all of those changes.
93
108
  this._hooks = {};
94
109
  __classPrivateFieldSet(this, _RenderContext_state, state, "f");
95
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useAsync.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAS3F,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhF;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,EAAE,OAAO,GAAG;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAUA;AAkGD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,EAC1C,WAAW,EAAE,wBAAwB,CAAC,CAAC,CAAC,EACxC,OAAO,GAAE,YAAiB,GACzB,cAAc,CAAC,CAAC,CAAC,CAUnB"}
1
+ {"version":3,"file":"useAsync.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAS3F,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAEhF;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,CAAC,EAAE,OAAO,GAAG;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAUA;AAmGD;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,EAC1C,WAAW,EAAE,wBAAwB,CAAC,CAAC,CAAC,EACxC,OAAO,GAAE,YAAiB,GACzB,cAAc,CAAC,CAAC,CAAC,CAwBnB"}
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _AsyncHook_debug, _AsyncHook_hookId, _AsyncHook_initializer, _AsyncHook_invalidate, _AsyncHook_ctx, _AsyncHook_localDepends;
12
+ var _AsyncHook_debug, _AsyncHook_hookId, _AsyncHook_invalidate, _AsyncHook_ctx;
13
13
  import { CIRCUIT_BREAKER_MSG } from '@devvit/shared-types/CircuitBreaker.js';
14
14
  import isEqual from 'lodash.isequal';
15
15
  import { registerHook } from './BlocksHandler.js';
@@ -37,19 +37,17 @@ class AsyncHook {
37
37
  constructor(initializer, options, params) {
38
38
  _AsyncHook_debug.set(this, void 0);
39
39
  _AsyncHook_hookId.set(this, void 0);
40
- _AsyncHook_initializer.set(this, void 0);
41
40
  _AsyncHook_invalidate.set(this, void 0);
42
41
  _AsyncHook_ctx.set(this, void 0);
43
- _AsyncHook_localDepends.set(this, void 0);
44
42
  __classPrivateFieldSet(this, _AsyncHook_debug, !!params.context.devvitContext.debug.useAsync, "f");
45
43
  if (__classPrivateFieldGet(this, _AsyncHook_debug, "f"))
46
44
  console.debug('[useAsync] v1', options);
47
45
  this.state = { data: null, load_state: 'initial', error: null, depends: null };
48
46
  __classPrivateFieldSet(this, _AsyncHook_hookId, params.hookId, "f");
49
- __classPrivateFieldSet(this, _AsyncHook_initializer, initializer, "f");
47
+ this.initializer = initializer;
50
48
  __classPrivateFieldSet(this, _AsyncHook_invalidate, params.invalidate, "f");
51
49
  __classPrivateFieldSet(this, _AsyncHook_ctx, params.context, "f");
52
- __classPrivateFieldSet(this, _AsyncHook_localDepends, options.depends ?? null, "f");
50
+ this.localDepends = options.depends ?? null;
53
51
  }
54
52
  /**
55
53
  * After we look at our state, we need to decide if we need to dispatch a request to load the data.
@@ -61,10 +59,12 @@ class AsyncHook {
61
59
  if (__classPrivateFieldGet(this, _AsyncHook_debug, "f"))
62
60
  console.debug('[useAsync] async onLoad ', __classPrivateFieldGet(this, _AsyncHook_hookId, "f"), this.state);
63
61
  if (__classPrivateFieldGet(this, _AsyncHook_debug, "f"))
64
- console.debug('[useAsync] async onLoad have ', __classPrivateFieldGet(this, _AsyncHook_localDepends, "f"), 'and', this.state.depends);
65
- if (!isEqual(__classPrivateFieldGet(this, _AsyncHook_localDepends, "f"), this.state.depends) || this.state.load_state === 'initial') {
62
+ console.debug('[useAsync] async onLoad have ', this.localDepends, 'and', this.state.depends);
63
+ if (!isEqual(this.localDepends, this.state.depends) || this.state.load_state === 'initial') {
64
+ if (__classPrivateFieldGet(this, _AsyncHook_debug, "f"))
65
+ console.debug(`[useAsync] attempting to resolve for hookId`, __classPrivateFieldGet(this, _AsyncHook_hookId, "f"));
66
66
  this.state.load_state = 'loading';
67
- this.state.depends = __classPrivateFieldGet(this, _AsyncHook_localDepends, "f");
67
+ this.state.depends = this.localDepends;
68
68
  __classPrivateFieldGet(this, _AsyncHook_invalidate, "f").call(this);
69
69
  const requeueEvent = {
70
70
  hook: __classPrivateFieldGet(this, _AsyncHook_hookId, "f"),
@@ -89,7 +89,7 @@ class AsyncHook {
89
89
  const asyncResponse = { requestId: event.asyncRequest.requestId };
90
90
  try {
91
91
  asyncResponse.data = {
92
- value: await __classPrivateFieldGet(this, _AsyncHook_initializer, "f").call(this),
92
+ value: await this.initializer(),
93
93
  };
94
94
  }
95
95
  catch (e) {
@@ -124,7 +124,7 @@ class AsyncHook {
124
124
  }
125
125
  }
126
126
  }
127
- _AsyncHook_debug = new WeakMap(), _AsyncHook_hookId = new WeakMap(), _AsyncHook_initializer = new WeakMap(), _AsyncHook_invalidate = new WeakMap(), _AsyncHook_ctx = new WeakMap(), _AsyncHook_localDepends = new WeakMap();
127
+ _AsyncHook_debug = new WeakMap(), _AsyncHook_hookId = new WeakMap(), _AsyncHook_invalidate = new WeakMap(), _AsyncHook_ctx = new WeakMap();
128
128
  /**
129
129
  * This is the preferred way to handle async state in Devvit.
130
130
  *
@@ -132,8 +132,22 @@ _AsyncHook_debug = new WeakMap(), _AsyncHook_hookId = new WeakMap(), _AsyncHook_
132
132
  * @returns UseAsyncResult<S>
133
133
  */
134
134
  export function useAsync(initializer, options = {}) {
135
- const hook = registerHook({ namespace: 'useAsync' }, (params) => {
136
- return new AsyncHook(initializer, options, params);
135
+ const hook = registerHook({
136
+ namespace: 'useAsync',
137
+ initializer: (params) => {
138
+ return new AsyncHook(initializer, options, params);
139
+ },
140
+ /**
141
+ * This is required due to hook caching. We need a way for certain values to always have the most
142
+ * up to date information before evaluating the hook again.
143
+ *
144
+ * initializer can use values from other stateful hook and always needs the latest values to be accurate
145
+ * localDepends is needed so that the dependency check is against the latest values
146
+ */
147
+ refresh: (h) => {
148
+ h.initializer = initializer;
149
+ h.localDepends = options.depends ?? null;
150
+ },
137
151
  });
138
152
  return {
139
153
  data: hook.state.data,
@@ -1 +1 @@
1
- {"version":3,"file":"useChannel.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useChannel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AA+HpE,wBAAgB,UAAU,CAAC,OAAO,SAAS,SAAS,EAClD,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,GACtC,gBAAgB,CAAC,OAAO,CAAC,CAU3B"}
1
+ {"version":3,"file":"useChannel.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useChannel.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AA+HpE,wBAAgB,UAAU,CAAC,OAAO,SAAS,SAAS,EAClD,IAAI,EAAE,QAAQ,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,GACtC,gBAAgB,CAAC,OAAO,CAAC,CAc3B"}
@@ -125,5 +125,9 @@ export function useChannel(opts) {
125
125
  // allow RealtimeEffectHandler to compute hook ID. maintain compatibility with
126
126
  // realtimeChannelToHookID().
127
127
  const id = `useChannel:${opts.name}`;
128
- return registerHook({ id, namespace: id }, (params) => new ChannelHook(opts, params));
128
+ return registerHook({
129
+ id,
130
+ namespace: id,
131
+ initializer: (params) => new ChannelHook(opts, params),
132
+ });
129
133
  }
@@ -15,7 +15,10 @@ class UseFormHook {
15
15
  }
16
16
  }
17
17
  export function useForm(form, onSubmit) {
18
- const hook = registerHook({ namespace: 'useForm' }, (params) => new UseFormHook(params, form, onSubmit));
18
+ const hook = registerHook({
19
+ namespace: 'useForm',
20
+ initializer: (params) => new UseFormHook(params, form, onSubmit),
21
+ });
19
22
  return hookRefToFormKey({ id: hook.hookId });
20
23
  }
21
24
  export function hookRefToFormKey(hookRef) {
@@ -1 +1 @@
1
- {"version":3,"file":"useInterval.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useInterval.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAqEpE,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpC,gBAAgB,EAAE,MAAM,GACvB,iBAAiB,CASnB"}
1
+ {"version":3,"file":"useInterval.d.ts","sourceRoot":"","sources":["../../../../../src/devvit/internals/blocks/handler/useInterval.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAqEpE,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EACpC,gBAAgB,EAAE,MAAM,GACvB,iBAAiB,CAYnB"}
@@ -73,8 +73,11 @@ class IntervalHook {
73
73
  }
74
74
  _IntervalHook_hookId = new WeakMap(), _IntervalHook_invalidate = new WeakMap(), _IntervalHook_callback = new WeakMap(), _IntervalHook_context = new WeakMap();
75
75
  export function useInterval(callback, requestedDelayMs) {
76
- const hook = registerHook({ namespace: 'useInterval' }, (params) => {
77
- return new IntervalHook(callback, requestedDelayMs, params);
76
+ const hook = registerHook({
77
+ namespace: 'useInterval',
78
+ initializer: (params) => {
79
+ return new IntervalHook(callback, requestedDelayMs, params);
80
+ },
78
81
  });
79
82
  return {
80
83
  start: () => hook.start(),
@@ -110,6 +110,9 @@ class UseStateHook {
110
110
  }
111
111
  _UseStateHook_changed = new WeakMap(), _UseStateHook_ctx = new WeakMap(), _UseStateHook_initializer = new WeakMap(), _UseStateHook_hookId = new WeakMap(), _UseStateHook_promise = new WeakMap();
112
112
  export function useState(initialState) {
113
- const hook = registerHook({ namespace: 'useState' }, (params) => new UseStateHook(initialState, params));
113
+ const hook = registerHook({
114
+ namespace: 'useState',
115
+ initializer: (params) => new UseStateHook(initialState, params),
116
+ });
114
117
  return [hook.state.value, hook.setter.bind(hook)];
115
118
  }
package/meta.json CHANGED
@@ -2777,18 +2777,13 @@
2777
2777
  "format": "esm"
2778
2778
  },
2779
2779
  "../protos/dist/types/devvit/runtime/runtime_common.js": {
2780
- "bytes": 7348,
2780
+ "bytes": 1828,
2781
2781
  "imports": [
2782
2782
  {
2783
2783
  "path": "../../node_modules/protobufjs/minimal.js",
2784
2784
  "kind": "import-statement",
2785
2785
  "original": "protobufjs/minimal.js"
2786
2786
  },
2787
- {
2788
- "path": "../protos/dist/types/google/protobuf/struct.js",
2789
- "kind": "import-statement",
2790
- "original": "../../google/protobuf/struct.js"
2791
- },
2792
2787
  {
2793
2788
  "path": "../protos/dist/types/typeRegistry.js",
2794
2789
  "kind": "import-statement",
@@ -8056,7 +8051,7 @@
8056
8051
  "format": "esm"
8057
8052
  },
8058
8053
  "../protos/dist/types/devvit/runtime/actor/echo.js": {
8059
- "bytes": 973,
8054
+ "bytes": 1029,
8060
8055
  "imports": [
8061
8056
  {
8062
8057
  "path": "../../node_modules/protobufjs/minimal.js",
@@ -8064,9 +8059,9 @@
8064
8059
  "original": "protobufjs/minimal.js"
8065
8060
  },
8066
8061
  {
8067
- "path": "../protos/dist/types/devvit/runtime/runtime_common.js",
8062
+ "path": "../protos/dist/types/google/protobuf/wrappers.js",
8068
8063
  "kind": "import-statement",
8069
- "original": "../runtime_common.js"
8064
+ "original": "../../../google/protobuf/wrappers.js"
8070
8065
  }
8071
8066
  ],
8072
8067
  "format": "esm"
@@ -12204,7 +12199,7 @@
12204
12199
  "format": "esm"
12205
12200
  },
12206
12201
  "src/devvit/internals/blocks/handler/useForm.ts": {
12207
- "bytes": 1910,
12202
+ "bytes": 1922,
12208
12203
  "imports": [
12209
12204
  {
12210
12205
  "path": "../shared-types/dist/useForm.js",
@@ -12261,7 +12256,7 @@
12261
12256
  "format": "esm"
12262
12257
  },
12263
12258
  "src/devvit/internals/blocks/handler/useChannel.ts": {
12264
- "bytes": 5738,
12259
+ "bytes": 5766,
12265
12260
  "imports": [
12266
12261
  {
12267
12262
  "path": "../protos/dist/index.js",
@@ -12292,7 +12287,7 @@
12292
12287
  "format": "esm"
12293
12288
  },
12294
12289
  "src/devvit/internals/blocks/handler/RenderContext.ts": {
12295
- "bytes": 7063,
12290
+ "bytes": 7910,
12296
12291
  "imports": [
12297
12292
  {
12298
12293
  "path": "<runtime>",
@@ -12303,7 +12298,7 @@
12303
12298
  "format": "esm"
12304
12299
  },
12305
12300
  "src/devvit/internals/blocks/handler/useInterval.ts": {
12306
- "bytes": 2540,
12301
+ "bytes": 2568,
12307
12302
  "imports": [
12308
12303
  {
12309
12304
  "path": "../protos/dist/index.js",
@@ -12339,7 +12334,7 @@
12339
12334
  "format": "esm"
12340
12335
  },
12341
12336
  "src/devvit/internals/blocks/handler/useAsync.ts": {
12342
- "bytes": 5534,
12337
+ "bytes": 6151,
12343
12338
  "imports": [
12344
12339
  {
12345
12340
  "path": "../shared-types/dist/CircuitBreaker.js",
@@ -12370,7 +12365,7 @@
12370
12365
  "format": "esm"
12371
12366
  },
12372
12367
  "src/devvit/internals/blocks/handler/useState.ts": {
12373
- "bytes": 4615,
12368
+ "bytes": 4627,
12374
12369
  "imports": [
12375
12370
  {
12376
12371
  "path": "src/devvit/internals/blocks/handler/BlocksHandler.ts",
@@ -12509,7 +12504,7 @@
12509
12504
  "format": "esm"
12510
12505
  },
12511
12506
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
12512
- "bytes": 18389,
12507
+ "bytes": 19643,
12513
12508
  "imports": [
12514
12509
  {
12515
12510
  "path": "@devvit/protos",
@@ -13881,7 +13876,7 @@
13881
13876
  "bytesInOutput": 9450
13882
13877
  },
13883
13878
  "../protos/dist/types/devvit/runtime/runtime_common.js": {
13884
- "bytesInOutput": 6812
13879
+ "bytesInOutput": 1631
13885
13880
  },
13886
13881
  "../protos/dist/types/devvit/service/bundle_service.js": {
13887
13882
  "bytesInOutput": 1728
@@ -13890,7 +13885,7 @@
13890
13885
  "bytesInOutput": 37009
13891
13886
  },
13892
13887
  "../protos/dist/types/devvit/runtime/serializable.js": {
13893
- "bytesInOutput": 7835
13888
+ "bytesInOutput": 7825
13894
13889
  },
13895
13890
  "../protos/dist/types/devvit/remote_logger/remote_logger.js": {
13896
13891
  "bytesInOutput": 18042
@@ -14208,7 +14203,7 @@
14208
14203
  "bytesInOutput": 11853
14209
14204
  },
14210
14205
  "../protos/dist/types/devvit/plugin/redditapi/privatemessages/privatemessages_msg.js": {
14211
- "bytesInOutput": 11866
14206
+ "bytesInOutput": 11851
14212
14207
  },
14213
14208
  "../protos/dist/types/devvit/plugin/redditapi/postcollections/postcollections_svc.js": {
14214
14209
  "bytesInOutput": 3667
@@ -14415,19 +14410,19 @@
14415
14410
  "bytesInOutput": 162
14416
14411
  },
14417
14412
  "src/devvit/internals/blocks/handler/useForm.ts": {
14418
- "bytesInOutput": 819
14413
+ "bytesInOutput": 830
14419
14414
  },
14420
14415
  "src/devvit/internals/blocks/handler/UIClient.ts": {
14421
14416
  "bytesInOutput": 2041
14422
14417
  },
14423
14418
  "src/devvit/internals/blocks/handler/useChannel.ts": {
14424
- "bytesInOutput": 5112
14419
+ "bytesInOutput": 5147
14425
14420
  },
14426
14421
  "src/devvit/internals/blocks/handler/RenderContext.ts": {
14427
- "bytesInOutput": 5070
14422
+ "bytesInOutput": 5599
14428
14423
  },
14429
14424
  "src/devvit/internals/blocks/handler/useInterval.ts": {
14430
- "bytesInOutput": 2414
14425
+ "bytesInOutput": 2447
14431
14426
  },
14432
14427
  "src/devvit/internals/blocks/handler/types.ts": {
14433
14428
  "bytesInOutput": 56
@@ -14436,10 +14431,10 @@
14436
14431
  "bytesInOutput": 138
14437
14432
  },
14438
14433
  "src/devvit/internals/blocks/handler/useAsync.ts": {
14439
- "bytesInOutput": 4317
14434
+ "bytesInOutput": 4725
14440
14435
  },
14441
14436
  "src/devvit/internals/blocks/handler/useState.ts": {
14442
- "bytesInOutput": 3762
14437
+ "bytesInOutput": 3766
14443
14438
  },
14444
14439
  "src/devvit/internals/blocks/handler/promise_cache.ts": {
14445
14440
  "bytesInOutput": 7624
@@ -14451,7 +14446,7 @@
14451
14446
  "bytesInOutput": 1362
14452
14447
  },
14453
14448
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
14454
- "bytesInOutput": 14625
14449
+ "bytesInOutput": 14675
14455
14450
  },
14456
14451
  "src/devvit/internals/ui-request-handler.ts": {
14457
14452
  "bytesInOutput": 639
@@ -14535,7 +14530,7 @@
14535
14530
  "bytesInOutput": 370
14536
14531
  }
14537
14532
  },
14538
- "bytes": 14799051
14533
+ "bytes": 14786471
14539
14534
  }
14540
14535
  }
14541
14536
  }
package/meta.min.json CHANGED
@@ -3528,7 +3528,7 @@
3528
3528
  "format": "esm"
3529
3529
  },
3530
3530
  "src/devvit/internals/blocks/handler/useForm.ts": {
3531
- "bytes": 1910,
3531
+ "bytes": 1922,
3532
3532
  "imports": [
3533
3533
  {
3534
3534
  "path": "../shared-types/dist/useForm.js",
@@ -3585,7 +3585,7 @@
3585
3585
  "format": "esm"
3586
3586
  },
3587
3587
  "src/devvit/internals/blocks/handler/useChannel.ts": {
3588
- "bytes": 5738,
3588
+ "bytes": 5766,
3589
3589
  "imports": [
3590
3590
  {
3591
3591
  "path": "@devvit/protos",
@@ -3616,7 +3616,7 @@
3616
3616
  "format": "esm"
3617
3617
  },
3618
3618
  "src/devvit/internals/blocks/handler/RenderContext.ts": {
3619
- "bytes": 7063,
3619
+ "bytes": 7910,
3620
3620
  "imports": [
3621
3621
  {
3622
3622
  "path": "<runtime>",
@@ -3627,7 +3627,7 @@
3627
3627
  "format": "esm"
3628
3628
  },
3629
3629
  "src/devvit/internals/blocks/handler/useInterval.ts": {
3630
- "bytes": 2540,
3630
+ "bytes": 2568,
3631
3631
  "imports": [
3632
3632
  {
3633
3633
  "path": "@devvit/protos",
@@ -3663,7 +3663,7 @@
3663
3663
  "format": "esm"
3664
3664
  },
3665
3665
  "src/devvit/internals/blocks/handler/useAsync.ts": {
3666
- "bytes": 5534,
3666
+ "bytes": 6151,
3667
3667
  "imports": [
3668
3668
  {
3669
3669
  "path": "../shared-types/dist/CircuitBreaker.js",
@@ -3694,7 +3694,7 @@
3694
3694
  "format": "esm"
3695
3695
  },
3696
3696
  "src/devvit/internals/blocks/handler/useState.ts": {
3697
- "bytes": 4615,
3697
+ "bytes": 4627,
3698
3698
  "imports": [
3699
3699
  {
3700
3700
  "path": "src/devvit/internals/blocks/handler/BlocksHandler.ts",
@@ -3833,7 +3833,7 @@
3833
3833
  "format": "esm"
3834
3834
  },
3835
3835
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
3836
- "bytes": 18389,
3836
+ "bytes": 19643,
3837
3837
  "imports": [
3838
3838
  {
3839
3839
  "path": "@devvit/protos",
@@ -4738,7 +4738,7 @@
4738
4738
  "imports": [],
4739
4739
  "exports": [],
4740
4740
  "inputs": {},
4741
- "bytes": 1188297
4741
+ "bytes": 1191226
4742
4742
  },
4743
4743
  "dist/public-api.min.js": {
4744
4744
  "imports": [
@@ -5439,16 +5439,16 @@
5439
5439
  "bytesInOutput": 74
5440
5440
  },
5441
5441
  "src/devvit/internals/blocks/handler/useForm.ts": {
5442
- "bytesInOutput": 367
5442
+ "bytesInOutput": 379
5443
5443
  },
5444
5444
  "src/devvit/internals/blocks/handler/useChannel.ts": {
5445
- "bytesInOutput": 2947
5445
+ "bytesInOutput": 2959
5446
5446
  },
5447
5447
  "src/devvit/internals/blocks/handler/useInterval.ts": {
5448
- "bytesInOutput": 1201
5448
+ "bytesInOutput": 1213
5449
5449
  },
5450
5450
  "src/devvit/internals/blocks/handler/RenderContext.ts": {
5451
- "bytesInOutput": 2404
5451
+ "bytesInOutput": 2387
5452
5452
  },
5453
5453
  "src/devvit/internals/blocks/handler/types.ts": {
5454
5454
  "bytesInOutput": 29
@@ -5457,10 +5457,10 @@
5457
5457
  "bytesInOutput": 66
5458
5458
  },
5459
5459
  "src/devvit/internals/blocks/handler/useAsync.ts": {
5460
- "bytesInOutput": 2077
5460
+ "bytesInOutput": 2206
5461
5461
  },
5462
5462
  "src/devvit/internals/blocks/handler/useState.ts": {
5463
- "bytesInOutput": 1486
5463
+ "bytesInOutput": 1498
5464
5464
  },
5465
5465
  "src/devvit/internals/blocks/handler/promise_cache.ts": {
5466
5466
  "bytesInOutput": 2598
@@ -5472,7 +5472,7 @@
5472
5472
  "bytesInOutput": 530
5473
5473
  },
5474
5474
  "src/devvit/internals/blocks/handler/BlocksHandler.ts": {
5475
- "bytesInOutput": 6630
5475
+ "bytesInOutput": 6676
5476
5476
  },
5477
5477
  "src/apis/reddit/helpers/makeGettersEnumerable.ts": {
5478
5478
  "bytesInOutput": 166
@@ -5550,7 +5550,7 @@
5550
5550
  "bytesInOutput": 178
5551
5551
  }
5552
5552
  },
5553
- "bytes": 250694
5553
+ "bytes": 250900
5554
5554
  }
5555
5555
  }
5556
5556
  }