This commit is contained in:
Михаил Капелько
2023-12-28 18:37:08 +03:00
parent 0a5dd210c7
commit f9612a878d
4 changed files with 4 additions and 12 deletions

View File

@@ -93,7 +93,7 @@ extension MeetupId {
ctrl.pipe(
dbg: "join",
sub: nil,
Bus.events.compactMap { Bus.convertKeyValue(K.join, $0) }.map { (k: String, v: Bool) in v }.map { _ in () }.eraseToAnyPublisher(),
Bus.events.compactMap { Bus.convertKeyValue(K.join, $0) }.map { (k: String, v: Void) in v }.eraseToAnyPublisher(),
{ $0.join = true },
{ $0.join = false }
)

View File

@@ -1,8 +1,7 @@
def pipeBusSource(name, entity, busKey, structure, fmtBusPipe, fmtBusPipeToggle):
def pipeBusSource(name, entity, busKey, structure, fmt):
valueType = structure.model.fields[name][0]
fmt = fmtBusPipe
if "toggle" in entity.pipes[name]:
fmt = fmtBusPipeToggle
valueType = "Void"
return fmt \
.replace("%BUS_KEY%", busKey) \

View File

@@ -5,7 +5,6 @@ from generation.pipeSource import *
def sectionGeneratedPipes(entity, sub, c):
fmtBusPipe = c.readFile(f"{c.dir}/templates/section-generated-pipe-src-bus")[0]
fmtBusPipeToggle = c.readFile(f"{c.dir}/templates/section-generated-pipe-src-bus-toggle")[0]
fmtExRecent = c.readFile(f"{c.dir}/templates/section-generated-pipe-ex-recent")
fmtRecent = c.readFile(f"{c.dir}/templates/section-generated-pipe-recent")
fmtSet = c.readFile(f"{c.dir}/templates/section-generated-pipe-set")
@@ -32,7 +31,7 @@ def sectionGeneratedPipes(entity, sub, c):
src = pipeSource(key, entity)
# Bus.
if src.startswith("K."):
src = pipeBusSource(key, entity, src, c.structure, fmtBusPipe, fmtBusPipeToggle)
src = pipeBusSource(key, entity, src, c.structure, fmtBusPipe)
fmtPipe = pipeFormat(fmtExRecent, fmtRecent, fmtSet, fmtToggle, fmtToggleNil, key, entity)
for fmt in fmtPipe:

View File

@@ -1,6 +0,0 @@
Bus.events.compactMap { Bus.convertKeyValue(%BUS_KEY%, $0) }.map { (k: String, v: %BUS_VALUE_TYPE%) in v }.map { _ in () }