@outbuild-company/schedule-core 1.10.1 → 1.10.3
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/README.md +35 -3
- package/dist/cdn/schedule-core.global.js +1 -1
- package/dist/cdn/schedule-core.global.js.map +1 -1
- package/dist/index.cjs +47 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +47 -10
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,9 +15,41 @@ The package exposes a single public entry point:
|
|
|
15
15
|
import { ScheduleCore } from '@outbuild-company/schedule-core';
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import {
|
|
22
|
+
COLUMN,
|
|
23
|
+
ScheduleCore,
|
|
24
|
+
type ScheduleCoreInput
|
|
25
|
+
} from '@outbuild-company/schedule-core';
|
|
26
|
+
|
|
27
|
+
const input: ScheduleCoreInput = getScheduleInput();
|
|
28
|
+
const core = new ScheduleCore(input);
|
|
29
|
+
await core.ready;
|
|
30
|
+
|
|
31
|
+
const result = await core.dispatch({
|
|
32
|
+
kind: 'inline-edit',
|
|
33
|
+
activityId,
|
|
34
|
+
column: COLUMN.TEXT,
|
|
35
|
+
newValue: 'Updated activity'
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
if (!result.ok) throw new Error(result.reason);
|
|
39
|
+
applyChangeSet(result.changes);
|
|
40
|
+
|
|
41
|
+
core.destroy();
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
`getScheduleInput`, `activityId`, and `applyChangeSet` are consumer-provided
|
|
45
|
+
values.
|
|
46
|
+
|
|
47
|
+
Schedule Core owns domain state and mutations. Consumers provide normalized
|
|
48
|
+
input, send commands through `dispatch()`, apply returned changes at the UI
|
|
49
|
+
boundary, and persist them at the storage boundary.
|
|
50
|
+
|
|
51
|
+
See the [complete API reference](docs/API.md) for initialization, every command,
|
|
52
|
+
read APIs, persistence, history, critical path, helpers, constants, and types.
|
|
21
53
|
|
|
22
54
|
## Development
|
|
23
55
|
|