@actor-system/behaviors 0.0.4 → 0.0.6
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/index.d.ts +1 -0
- package/dist/index.internal.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/receive.js +6 -5
- package/dist/restart.js +6 -3
- package/dist/stopped.js +6 -4
- package/dist/unhandled.d.ts +5 -0
- package/dist/unhandled.internal.d.ts +5 -0
- package/dist/unhandled.js +5 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { same } from './same.js';
|
|
|
6
6
|
export { setup } from './setup.js';
|
|
7
7
|
export { stopped } from './stopped.js';
|
|
8
8
|
export { supervise } from './supervise.js';
|
|
9
|
+
export { unhandled } from './unhandled.js';
|
|
9
10
|
export { Stash, withStash } from './with-stash.js';
|
|
10
11
|
export { Timers, withTimers } from './with-timers.js';
|
|
11
12
|
export { Behavior } from '@actor-system/core';
|
package/dist/index.internal.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { same } from './same.internal.js';
|
|
|
6
6
|
export { setup } from './setup.internal.js';
|
|
7
7
|
export { stopped } from './stopped.internal.js';
|
|
8
8
|
export { supervise } from './supervise.internal.js';
|
|
9
|
+
export { unhandled } from './unhandled.internal.js';
|
|
9
10
|
export { Stash, withStash } from './with-stash.internal.js';
|
|
10
11
|
export { Timers, withTimers } from './with-timers.internal.js';
|
|
11
12
|
export { Behavior } from '@actor-system/core/internal';
|
package/dist/index.js
CHANGED
|
@@ -6,5 +6,6 @@ export { same } from './same.js';
|
|
|
6
6
|
export { setup } from './setup.js';
|
|
7
7
|
export { stopped } from './stopped.js';
|
|
8
8
|
export { supervise } from './supervise.js';
|
|
9
|
+
export { unhandled } from './unhandled.js';
|
|
9
10
|
export { withStash } from './with-stash.js';
|
|
10
11
|
export { withTimers } from './with-timers.js';
|
package/dist/receive.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { behavior, signal } from '@actor-system/core';
|
|
2
2
|
import { same } from './same.js';
|
|
3
|
+
import { unhandled } from './unhandled.js';
|
|
3
4
|
|
|
4
5
|
const receiveMessage = (onMessage) => ({
|
|
5
|
-
...behavior.receive((message, ctx) => !signal.isSignal(message) ? (onMessage(message, ctx) ??
|
|
6
|
+
...behavior.receive((message, ctx) => !signal.isSignal(message) ? (onMessage(message, ctx) ?? unhandled) : same),
|
|
6
7
|
receiveSignal: (onSignal) => behavior.receive((message, context) => (!signal.isSignal(message)
|
|
7
8
|
? onMessage(message, context)
|
|
8
|
-
: onSignal(message, context)) ??
|
|
9
|
+
: onSignal(message, context)) ?? unhandled),
|
|
9
10
|
});
|
|
10
11
|
const receiveSignal = (onSignal) => ({
|
|
11
|
-
...behavior.receive((message, ctx) => signal.isSignal(message) ? (onSignal(message, ctx) ??
|
|
12
|
+
...behavior.receive((message, ctx) => signal.isSignal(message) ? (onSignal(message, ctx) ?? unhandled) : same),
|
|
12
13
|
receiveMessage: (onMessage) => behavior.receive((message, context) => (signal.isSignal(message)
|
|
13
14
|
? onSignal(message, context)
|
|
14
|
-
: onMessage(message, context)) ??
|
|
15
|
+
: onMessage(message, context)) ?? unhandled),
|
|
15
16
|
});
|
|
16
|
-
const receive = (handler) => behavior.receive((message, ctx) => handler(message, ctx) ??
|
|
17
|
+
const receive = (handler) => behavior.receive((message, ctx) => handler(message, ctx) ?? unhandled);
|
|
17
18
|
|
|
18
19
|
export { receive, receiveMessage, receiveSignal };
|
package/dist/restart.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { behavior } from '@actor-system/core';
|
|
1
|
+
import { behavior, $type } from '@actor-system/core';
|
|
2
2
|
|
|
3
|
-
const restart = (checkpoint) =>
|
|
4
|
-
|
|
3
|
+
const restart = (checkpoint) => ({
|
|
4
|
+
[$type]: undefined,
|
|
5
|
+
_tag: behavior.$control,
|
|
6
|
+
_operation: "restart",
|
|
7
|
+
_checkpoint: checkpoint,
|
|
5
8
|
});
|
|
6
9
|
|
|
7
10
|
export { restart };
|
package/dist/stopped.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { behavior } from '@actor-system/core';
|
|
1
|
+
import { behavior, $type } from '@actor-system/core';
|
|
2
2
|
|
|
3
|
-
const stopped =
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const stopped = {
|
|
4
|
+
[$type]: undefined,
|
|
5
|
+
_tag: behavior.$control,
|
|
6
|
+
_operation: "stop",
|
|
7
|
+
};
|
|
6
8
|
|
|
7
9
|
export { stopped };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@actor-system/behaviors",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"type-check": "tsc -b src",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@actor-system/shared"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@actor-system/core": "0.0.
|
|
31
|
+
"@actor-system/core": "0.0.6"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@actor-system/testing": "0.0.2",
|