Fork me on GitHub
#hoplon
<
2017-07-03
>
thedavidmeister00:07:34

@flyboarder yeah cool, it should be pretty easy to swap between the two using closure

cycle33708:07:33

hey guys please help a fella out

cycle33708:07:58

I'm using hoplon's route-cell to redirect on "../#manage?id="

cycle33708:07:11

how to capture the id in case-tpl ?

cycle33708:07:48

can it be done or need to switch to secretary ?

thedavidmeister08:07:29

@avabinary route-cell is quite low lovel, there's an example using bidi ^^

thedavidmeister08:07:50

uses google's history API instead

cycle33708:07:16

@thedavidmeister can't find the example, is it on the hoplon brew github ?

thedavidmeister08:07:57

is what @flyboarder refactored recently

cycle33710:07:05

seems like it was easier to use route-cell and just define a defroute onto which to append my id

cycle33710:07:11

it worked with secretary

thedavidmeister11:07:32

@avabinary yeah secretary works fine, i used to use that myself ๐Ÿ™‚

dm311:07:45

@thedavidmeister I think you (or someone else here) had similar issues with modifying inputs in a for-tpl like a ~year ago ๐Ÿ™‚

thedavidmeister11:07:03

maybe also someone else

thedavidmeister11:07:09

but definitely me too ๐Ÿ˜›

thedavidmeister11:07:18

this is a gnarlier version of that

dm311:07:05

so 2-way databinding strikes again

thedavidmeister11:07:45

@dm3 i actually came up with a workaround that wasn't based on timeouts this time ๐Ÿ™‚

thedavidmeister11:07:02

also, can't really live without form inputs

dm311:07:58

there needs to be a pattern documented somewhere in Hoplon

dm311:07:27

this scenario explained step by step

dm311:07:22

turn 2-way databinding on the same variable cell -> :value -> input | input -> :value -> cell to cell -> :value | input -> event -> :value2 -> cell

thedavidmeister11:07:23

@dm3 so, it's a similar approach

thedavidmeister11:07:40

basically "redoing" the val in response to things other than the value cell itself changing

thedavidmeister11:07:31

micha proposed an event handler (although realistically it would be probably half a dozen to cover off everything)

thedavidmeister11:07:13

and i'm proposing multiple cells

dm311:07:13

seems so

thedavidmeister11:07:47

also, the multiple cells approach can look like the event approach if you just bind an event to update one of those extra cells

thedavidmeister11:07:55

:value [value keyup]
:keyup #(swap! keyup random-uuid)

dm311:07:50

so how would one apply your approach generically?

thedavidmeister12:07:28

mmm, what do you mean by that?

dm312:07:03

well, this is definitely a pattern within Hoplon - dealing with 2-way databinding situations

dm312:07:17

so the solution needs to be a part of Hoplon too I think

thedavidmeister12:07:10

it's not the prettiest code but i think you'll get the idea

thedavidmeister12:07:40

wow... i only just realised that if you use namespaced attributes you can bind multiple events with on! ๐Ÿ˜•

dm312:07:54

ah, I see

thedavidmeister12:07:38

i got the test to pass with :value [(j/cell= (get data k)) sorted-data]

thedavidmeister12:07:26

because i know that re-sorting the data will mix the values up in a way that a simple get won't be able to respond to

dm312:07:58

why first cell in :value isnโ€™t just v?

thedavidmeister12:07:55

same result either way, i'll push v up so you can see

thedavidmeister12:07:42

using v and [v data] respectively, to give a few examples

thedavidmeister12:07:58

hmm, failed on my local and passed on travis -_-

thedavidmeister12:07:01

lemme look into that

thedavidmeister12:07:06

i don't know what happened earlier ๐Ÿ˜•

dm317:07:58

@thedavidmeister you trading some cryptocurrencies? ๐Ÿ™‚

dm317:07:20

ant-foxing looks interesting

thedavidmeister23:07:56

@dm3 haha yeah, actually i bought some btc a few years ago and now i want to split that out into a few different currencies