funcool

A channel for discussing and asking questions about Funcool libraries https://github.com/funcool/
2021-02-28T12:35:46.000900Z

how do I get beicon to work?

2021-02-28T12:36:01.001200Z

i have a problem with The required namespace "beicon.impl.rxjs-operators" is not available

2021-02-28T12:36:27.001400Z

I have added rxjs to package.json

2021-02-28T12:43:25.001900Z

problem solved, in node-repl it doesn't work, in browser-repl there is no problem

2021-02-28T12:55:51.002100Z

still something doesn't work ;(

2021-02-28T12:56:13.002300Z

The required JS dependency "rxjs/Rx" is not available, it was required by "beicon/impl/rxjs.cljs"

2021-02-28T13:04:54.002600Z

from what I see and read, the library is set up to work with figwheel, not shadow-cljs

2021-02-28T17:08:29.003100Z

why does ptk/add-watch not call the function added with add-watch to ptk/store?

2021-02-28T17:09:12.003300Z

http://ix.io/2Rd9

niwinz 2021-02-28T17:23:36.004400Z

hi @huxley, we are using beicon at https://github.com/penpot/penpot and it works correctly with shadow-cljs, but it needs some tweaks in order to correctly work

2021-02-28T17:24:00.004700Z

Yes, I know, I found 😉

niwinz 2021-02-28T17:24:12.005100Z

oh nice,

2021-02-28T17:24:25.005700Z

I have already added the files from the vendor directory

2021-02-28T17:25:01.006600Z

oh yeah, that's files

niwinz 2021-02-28T17:25:18.007300Z

about potok, unfortunatelly the documentation is outdated; as I don't expected that the library is heavy used outside from my own projects 😛

niwinz 2021-02-28T17:26:11.008100Z

because is not very popular way to handle state, and the the people used to have some fear to RX

2021-02-28T17:26:30.008400Z

regarding ptk/add-watch, I have already found that (rx/delay) messes everything up

2021-02-28T17:27:08.008800Z

I'm tired of re-frame & reagent and looking for something new

niwinz 2021-02-28T17:28:29.010300Z

hehe nice, probably penpot is a good source for knowing how potok+beicon works; the badside is that the project is pretty big that does not help

niwinz 2021-02-28T17:28:55.010700Z

i'll try to have some time this week for update potok documentation

2021-02-28T17:32:29.011200Z

I'm maintaining >5 years old ecommerce that uses rum fork rum and datascript fork. Compared to it penpot is lovely, simple, organized and super readable 😉

2021-02-28T17:33:53.011600Z

Anyway, don't worry about the documentation, it's all in the code, which is well described.

niwinz 2021-02-28T17:33:57.011800Z

oh, thanks! 😊

2021-02-28T17:36:04.012100Z

btw, you are probably the best example of a person suffering from a lisp course 😉 you produce an incredible amount of libraries and you always use your own solutions

2021-02-28T17:36:32.012300Z

and that's great, because less able people like me have it easier

2021-02-28T17:36:36.012500Z

xD

niwinz 2021-02-28T17:45:42.014700Z

hehehe, i'm just curious and try to find a simple solutions for my own problems and challenges; and spend a good amount of time on research on how to improve the currently established solutions

niwinz 2021-02-28T17:48:47.017700Z

the potok, rumext and okulary is probably a portion of result of this; potok right now is probably 5 years old and it has aged pretty well; we as a team developing penpot did't found real obstacles with the current architecture of state management of the application... I didn't have the same experience with redux, flow and other similar aproaches form the JS world

niwinz 2021-02-28T17:51:05.019100Z

potok only suffers from the learning curve, because it requires knowing rx pretty well for more advanced stuff

2021-02-28T18:03:41.019600Z

I'm just trying to figure out how to display the rx/stream data using rum

2021-02-28T18:05:29.020Z

I haven't seen rx/to-atom used anywhere in the penpot, and that's the only thing I can think of

niwinz 2021-02-28T18:13:04.021Z

@huxley this is something related to documentation 😞 ; look at this line https://github.com/penpot/penpot/blob/develop/frontend/src/app/main/store.cljs#L26

niwinz 2021-02-28T18:13:13.021500Z

the state is already an atom

niwinz 2021-02-28T18:13:20.021700Z

so you can use it from rum as-is

niwinz 2021-02-28T18:14:01.022400Z

the idea behind this, is that all changes are async, but state should be accessed using synchronous primitives

2021-02-28T18:14:34.022700Z

I got what you're talking about, it's easy

2021-02-28T18:14:54.022900Z

but I've got another idea I can't make happen

2021-02-28T18:15:50.023200Z

I know I can use l/derived too, but that's not what I have in mind yet.

2021-02-28T18:17:09.023400Z

I'll try to explain in my limited English

2021-02-28T18:19:42.023800Z

You definitely know datascript and maybe you know posh

niwinz 2021-02-28T18:20:09.024200Z

yeah, I know it but never used it

2021-02-28T18:20:35.024500Z

The posh listens for changes in the db, and checks if these changes match the query

2021-02-28T18:21:53.025800Z

I wanted to make a stream where I have the difference between old-db and new-db

2021-02-28T18:22:02.026Z

I've already got it

2021-02-28T18:22:30.026400Z

I also have functions that listen for these differences and based on them return something

2021-02-28T18:23:06.026800Z

and I'd like to use this "something" with rum

niwinz 2021-02-28T18:23:41.027300Z

probably the easiest way to it is materialize the result of a stream into an atom

niwinz 2021-02-28T18:24:18.028Z

atom is a good synchronous primitive for storing the result of a curret result of some process

2021-02-28T18:24:33.028500Z

Great!

niwinz 2021-02-28T18:25:02.029200Z

if you have a stream of "something" (results)

niwinz 2021-02-28T18:25:15.029500Z

just use to-atom for materialize it to an atom

niwinz 2021-02-28T18:25:40.029900Z

you also have the option to use BehaviorSubject of RX

niwinz 2021-02-28T18:25:55.030300Z

is analogous to atom

niwinz 2021-02-28T18:26:23.031Z

but need some adaptations in order to make it work with rum

2021-02-28T18:26:24.031100Z

I tried to do a deref a subject

2021-02-28T18:27:23.031700Z

but it looks like the data needs to be pulled out somehow differently

niwinz 2021-02-28T18:28:07.031800Z

niwinz 2021-02-28T18:28:23.032500Z

For rumext, we have this hook (react hook)

niwinz 2021-02-28T18:28:44.032900Z

is analogous to rum and rumext deref

2021-02-28T18:28:54.033200Z

awesome

niwinz 2021-02-28T18:28:57.033400Z

for subjects

2021-02-28T18:32:15.033700Z

this is it!

2021-02-28T18:32:35.033900Z

I think I have all the pieces of the puzzle to replace the current stack

2021-02-28T18:32:43.034100Z

thank you, you helped me a lot

niwinz 2021-02-28T18:32:58.034300Z

np