dsh-caveman 0.1.1 → 0.1.2
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/lib/index.js +8 -3
- package/package.json +2 -2
package/lib/index.js
CHANGED
|
@@ -61,9 +61,11 @@ export function apply(ctx) {
|
|
|
61
61
|
const projections = ctx.get('sessionProjections')
|
|
62
62
|
|
|
63
63
|
if (projections !== undefined) {
|
|
64
|
+
// rc.7+: client visibility requires wire (viewSchema + view); the bare
|
|
65
|
+
// top-level schema/view fields are ignored by the rc.2 registry.
|
|
64
66
|
projections.register({
|
|
65
67
|
key: 'caveman',
|
|
66
|
-
schema,
|
|
68
|
+
stateSchema: schema,
|
|
67
69
|
stateVersion: 1,
|
|
68
70
|
init: () => ({ mode: 'full' }),
|
|
69
71
|
apply: (state, event) => {
|
|
@@ -72,7 +74,10 @@ export function apply(ctx) {
|
|
|
72
74
|
if (!VALID.includes(mode) || state.mode === mode) return state
|
|
73
75
|
return { mode }
|
|
74
76
|
},
|
|
75
|
-
|
|
77
|
+
wire: {
|
|
78
|
+
viewSchema: schema,
|
|
79
|
+
view: (state) => ({ mode: state.mode }),
|
|
80
|
+
},
|
|
76
81
|
})
|
|
77
82
|
}
|
|
78
83
|
|
|
@@ -190,4 +195,4 @@ export function apply(ctx) {
|
|
|
190
195
|
}
|
|
191
196
|
|
|
192
197
|
console.log('[caveman] host active (event projection + KNOWN registration)')
|
|
193
|
-
}
|
|
198
|
+
}
|