ballerina-core 1.0.20 → 1.0.22

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "ballerina-core",
3
3
  "author": "Dr. Giuseppe Maggiore",
4
4
  "private": false,
5
- "version": "1.0.20",
5
+ "version": "1.0.22",
6
6
  "main": "main.ts",
7
7
  "dependencies": {
8
8
  "immutable": "^5.0.0-beta.5",
@@ -1,4 +1,4 @@
1
- import { ApiErrors, AsyncState, Debounce, Debounced, EditFormForeignMutationsExpected, EditFormState, Synchronize, Synchronized, Unit } from "../../../../../../../main"
1
+ import { ApiErrors, AsyncState, Debounce, Debounced, EditFormForeignMutationsExpected, EditFormState, Synchronize, Synchronized, Unit, Value } from "../../../../../../../main"
2
2
  import { CoTypedFactory } from "../../../../../../coroutines/builder"
3
3
  import { EditFormContext, EditFormWritableState } from "../state"
4
4
 
@@ -7,8 +7,8 @@ export const editFormRunner = <E, FS>() => {
7
7
 
8
8
  const init =
9
9
  Co.GetState().then(current =>
10
- Synchronize<Unit, Synchronized<E, ApiErrors>>(() => current.api.get().then(e =>
11
- Synchronized.Default<E, ApiErrors>(e)
10
+ Synchronize<Unit, Synchronized<Value<E>, ApiErrors>>(() => current.api.get().then(e =>
11
+ Synchronized.Default<Value<E>, ApiErrors>(Value.Default(e))
12
12
  ), _ => "transient failure", 5, 50)
13
13
  .embed(_ => _.entity,
14
14
  _ => EditFormState<E, FS>().Updaters.Core.entity(Debounced.Updaters.Core.value(_)))
@@ -17,11 +17,12 @@ export const editFormRunner = <E, FS>() => {
17
17
  const synchronize =
18
18
  Co.Repeat(
19
19
  Co.GetState().then(current =>
20
- Debounce<Synchronized<Unit, Synchronized<E, ApiErrors>>, EditFormContext<E, FS>>(
21
- Synchronize<E, ApiErrors>(e => current.api.update(e), _ => "transient failure", 5, 50)
20
+ Debounce<Synchronized<Unit, Synchronized<Value<E>, ApiErrors>>, EditFormContext<E, FS>>(
21
+ Synchronize<Value<E>, ApiErrors>(e => current.api.update(e.value), _ => "transient failure", 5, 50)
22
22
  .embed(
23
23
  _ => AsyncState.Operations.hasValue(_.sync) ? _.sync.value : undefined,
24
- _ => Synchronized.Updaters.sync<Unit, Synchronized<E, ApiErrors>>(AsyncState.Operations.map(_))
24
+ _ => Synchronized.Updaters.sync<Unit, Synchronized<Value<E>, ApiErrors>>(
25
+ AsyncState.Operations.map(_))
25
26
  ),
26
27
  15
27
28
  ).embed(
@@ -14,7 +14,7 @@ export type EditFormContext<E,FS> = {
14
14
 
15
15
  export type EditFormState<E,FS> = {
16
16
  // first sync is GET (returns E), second is UPDATE (accepts E)
17
- entity:Debounced<Synchronized<Unit, Synchronized<E, ApiErrors>>>
17
+ entity:Debounced<Synchronized<Unit, Synchronized<Value<E>, ApiErrors>>>
18
18
  formState:FS,
19
19
  }
20
20
 
@@ -37,8 +37,9 @@ export const EditFormState = <E,FS>() => ({
37
37
  Synchronized.Updaters.sync(
38
38
  AsyncState.Operations.map(
39
39
  Synchronized.Updaters.value(
40
+ Value.Updaters.value(
40
41
  _
41
- )
42
+ ))
42
43
  )
43
44
  )
44
45
  )
@@ -17,7 +17,7 @@ export const EditFormTemplate = <E, FS>() : EditFormTemplate<E,FS> =>
17
17
  !AsyncState.Operations.hasValue(props.context.entity.sync) ? undefined :
18
18
  props.context.actualForm({
19
19
  context: {
20
- value: props.context.entity.sync.value,
20
+ value: props.context.entity.sync.value.value,
21
21
  ...props.context.formState,
22
22
  },
23
23
  setState: _ => {
@@ -66,7 +66,7 @@ export const builtInsFromFieldViews = (fieldViews: any, fieldTypeConverters: Api
66
66
  "generics": Map([
67
67
  ["SingleSelection", { apiConverters: fieldTypeConverters["SingleSelection"], defaultValue: CollectionSelection().Default.right("no selection") }] as [string, GenericBuiltIn],
68
68
  ["Multiselection", { apiConverters: fieldTypeConverters["SingleSelection"], defaultValue: Map() }] as [string, GenericBuiltIn],
69
- ["List", { apiConverters: fieldTypeConverters["SingleSelection"], defaultValue: [] }] as [string, GenericBuiltIn]
69
+ ["List", { apiConverters: fieldTypeConverters["SingleSelection"], defaultValue: List() }] as [string, GenericBuiltIn]
70
70
  ]),
71
71
  "renderers": {
72
72
  "boolean": Set(),