MCPcopy Create free account
hub / github.com/clientdb/clientdb / create

Function create

core/client.ts:139–154  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

137 return hasItemsComputed.get();
138 },
139 create(input) {
140 const newEntity = createStoreEntity(input);
141
142 return runInAction(() => {
143 store.add(newEntity);
144 events.emit("created", {
145 db,
146 entity: newEntity,
147 type: "created",
148 rollback() {
149 store.remove(newEntity.getId());
150 },
151 });
152 return newEntity;
153 });
154 },
155 remove(id) {
156 return runInAction(() => {
157 const entity = store.findById(id);

Callers

nothing calls this directly

Calls 2

createStoreEntityFunction · 0.85
addMethod · 0.80

Tested by

no test coverage detected