mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-11 07:00:45 +08:00
Stop requiring dsh-client-store in the Plugins card bundle.
Shipped dsh web seed has no client-store entry; use a private snapshot store and only externalize platform seed modules. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
e45657b1ee
commit
69a4820369
6 changed files with 78 additions and 25 deletions
|
|
@ -333,8 +333,27 @@ function NetxopsCard(props) {
|
|||
});
|
||||
}
|
||||
|
||||
// src/client/snapshot-store.ts
|
||||
function createSnapshotStore(init) {
|
||||
let state = init;
|
||||
const listeners = new Set;
|
||||
return {
|
||||
getSnapshot: () => state,
|
||||
subscribe: (listener) => {
|
||||
listeners.add(listener);
|
||||
return () => {
|
||||
listeners.delete(listener);
|
||||
};
|
||||
},
|
||||
set: (next) => {
|
||||
state = next;
|
||||
for (const listener of [...listeners])
|
||||
listener();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// src/client/card-form.ts
|
||||
var import_dsh_client_store = require("@deepseek-ai/dsh-client-store");
|
||||
function textField(field) {
|
||||
return {
|
||||
field,
|
||||
|
|
@ -363,7 +382,7 @@ class CardForm {
|
|||
});
|
||||
}
|
||||
bind(project) {
|
||||
const store = import_dsh_client_store.createSnapshotStore(project());
|
||||
const store = createSnapshotStore(project());
|
||||
this.listeners.add(() => {
|
||||
store.set(project());
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue