mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-11-05 11:38:36 +09:00
Quite requested improvement. Instead of selecting parent on delete select next or previous sibling to be able to clean items within collections with minimal amount of actions. For testing - delete first item in a list - delete last item in a list - delete the only item in a list
17 lines
400 B
TypeScript
17 lines
400 B
TypeScript
import { atom } from "nanostores";
|
|
import { createPubsub } from "./create";
|
|
|
|
export interface PubsubMap {
|
|
command: {
|
|
source: string;
|
|
name: string;
|
|
};
|
|
}
|
|
|
|
export const { publish, usePublish, useSubscribe, subscribe } =
|
|
createPubsub<PubsubMap>();
|
|
export type Publish = typeof publish;
|
|
export type UsePublish = typeof usePublish;
|
|
|
|
export const $publisher = atom<{ publish?: Publish }>({});
|