dw-innovation / dw-kid2-graph-frontend-prototype

dw-kid2-graph-frontend-prototype.vercel.app
MIT License
0 stars 0 forks source link

Observable as Hook #53

Closed nikonikoniko closed 2 years ago

nikonikoniko commented 2 years ago

Integrate observable as hook into the react world.

This way each block component can offer an observable as to when it is available.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
dw-kid2-graph-frontend-prototype ❌ Failed (Inspect) Jun 20, 2022 at 2:32PM (UTC)
tlmn commented 2 years ago

looks good to me :) general question though: why not use rxdb-hooks?

nikonikoniko commented 2 years ago

looks good to me :) general question though: why not use rxdb-hooks?

Just in case the block wants to use more complicated functionality. these are created primarily for the Block.isAvailable function. The block might only be available if an external service is available, and you have the data to operate on already in the database.

In this case, the Block's responsibility is to expose it's availability either as a promise or observable, which may have implementations outside of rxdb-hooks.