(plugin?: Partial<Plugin>)
| 174 | |
| 175 | (set, get) => ({ |
| 176 | create(plugin?: Partial<Plugin>) { |
| 177 | const plugins = get().plugins; |
| 178 | const id = plugin?.id || nanoid(); |
| 179 | plugins[id] = { |
| 180 | ...createEmptyPlugin(), |
| 181 | ...plugin, |
| 182 | id, |
| 183 | builtin: false, |
| 184 | }; |
| 185 | |
| 186 | set(() => ({ plugins })); |
| 187 | get().markUpdate(); |
| 188 | |
| 189 | return plugins[id]; |
| 190 | }, |
| 191 | updatePlugin(id: string, updater: (plugin: Plugin) => void) { |
| 192 | const plugins = get().plugins; |
| 193 | const plugin = plugins[id]; |
nothing calls this directly
no test coverage detected