Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    David Sheldrick
    @ds300
    And I have considered devtools for Derivable but I'm not sure the kind of visual graph thing you described would be useful. I've thought about some browser devtools for a higher-level app framework I've been designing, but that relies on a particular kind of data store which doesn't exist yet.
    Andrey Popp
    @andreypopp
    would be interesting just to see a list of atoms then derivable tree for each one of them
    then some highlights when values change
    then some API for annotations in model (derivable) so one could scale devtools to any of the arch their app uses (flux, ...)
    David Sheldrick
    @ds300
    Interesting? Sure. Useful? I'm not convinced. How would it improve DX? I can't see it helping to grok a codebase, since the code is already declarative. One of the great benefits of derivables is that you only need to know about immediate parents in order to grok what a particular derivable is all about, and the immediate parents are right there in the source code.
    Andrey Popp
    @andreypopp

    I think seeing what atoms you have in app is useful because this is what your app is about, full picture. Guess there will single (usually) atom with app state, several with component local state (think React app), then atoms which bridges external state (browser history) — could be useful to have an API to tag atoms somehow (component local, app, history.

    Then see what changes when you interact with the app.

    Also seeing what reactors are active (could be also made with tagging). Like what components are subscribed to what and when they are re-rendered.

    Sorry for mind dumping, I'll write a proposal maybe in a gist sometime.
    Andrey Popp
    @andreypopp
    @ds300 would be cool to have another beta published on npm (with flow typings) so I can start adding typings to my code
    react-derivable and in-house
    David Sheldrick
    @ds300
    Of course. Just published derivable@beta10. Sorry I should have done that right after merging your Flow PR.
    Andrey Popp
    @andreypopp
    thanks!
    Andrey Popp
    @andreypopp
    What do you think about deprecating Derivable.derive() method and suggest to use derivation() instead? It looks more symmetrical and also less confusing, I think.
    Like 1) does the function passed to .derive() method allows to deref other derivable? Will they be tracked then? 2) less API surface 3) consistent pattern for accessing derivable value d.get() vs. d.derive(v => ...)
    David Sheldrick
    @ds300
    My first reaction is that this would be a bad idea because .derive has all kinds of syntactic benefits that I personally use all the time. However, you raise valid points. And I like the idea of keeping API surface area minimal even at the cost of syntactic verbosity. I'll definitely think about this.
    Andrey Popp
    @andreypopp
    Derivable based flux implementation which runs computations in a web worker: yes or no?
    David Sheldrick
    @ds300
    Sounds cool. A hearty yes.
    Andrey Popp
    @andreypopp
    I wonder if it would be useful to have an ability to give atoms/reactions names.
    For debug/devtool purposes.
    David Sheldrick
    @ds300
    Yeah that would be cool. I've actually done that ad-hoc for debugging the framework itself. The existing debug mode works pretty well for just showing which derivations are throwing errors, but don't really help with seeing hierarchies, which naming would be good for.
    Andrey Popp
    @andreypopp
    Improved flow typings... ds300/derivablejs#48
    Andrey Popp
    @andreypopp
    btw. writing a blog post about derivable as a query layer for redux
    @ds300 may I ask for a review a little bit later?
    David Sheldrick
    @ds300
    Sure I'd be happy to. And thanks for the PR, I'll try to take a look tonight. It's so great to have ypu contributing awesome stuff, :+1:
    Andrey Popp
    @andreypopp
    Also I have a question regarding lifecycle. I tried to build a derivation which runs in a web worker.
    deriveInWorker<T, R>(source: Derivation<T>, derive: (value: T) => R): Derivation<?R>
    Basically it returns null if result isn't ready yet
    My naive impl was to setup a reaction on source and submit task to a worker and put result eventually into another atom I return from deriveInWorker. Then (important) I want not to do any work if there's no reactions active on the derivation I return.
    But I'm not sure it is possible now to do that as I don't have access to derivation lifecycle
    Andrey Popp
    @andreypopp
    I moved this question to an issue: ds300/derivablejs#49
    Andrey Popp
    @andreypopp
    plan to make a series of small blog posts, each focused in a single topic
    cc @ds300 ^^
    David Sheldrick
    @ds300
    I read it and will type up some notes tonight. Good stuff though. :+1:
    Andrey Popp
    @andreypopp
    Thanks, I published it but didn't yet post it anywhere.
    https://medium.com/@andreypopp/4146107ed247 3rd (not yet published, private link)
    Andrey Popp
    @andreypopp
    David Sheldrick
    @ds300
    @andreypopp re: notes, how concerned are you about grammar? Your grammar is pretty good considering english isn't your first language so I don't want to seem nitpicky by offering a bunch of notes on grammar.
    Andrey Popp
    @andreypopp
    @ds300 super concerned, would really be happy to improve my english skills
    Will Mruzek
    @mruzekw
    @andreypopp Looking forward to the series of blog posts
    Will Mruzek
    @mruzekw
    @andreypopp What do you think about throwing ImmutableJS into the mix?
    Andrey Popp
    @andreypopp
    @mruzekw yeah, thought about that. btw you can submit an article to Learn Derivable on Medium :-)
    Andrey Popp
    @andreypopp
    @ds300 thanks, super useful feedback, I improved the article
    David Sheldrick
    @ds300
    No worries. I only did grammar feedback for the first one, will try to get around to the others soon.
    Will Mruzek
    @mruzekw

    I'm trying to build a game with DerivableJS

    https://gist.github.com/mruzekw/84a43be6490ae532515e90252933a38f

    It's simple. The user is shown a 5x5 matrix of squares. Nine of them are highlighted for 5 seconds. Then the user has to select those squares to win the game.
    You can find a demo here: http://mruzekw.github.io/recall-reactjs/

    I'm currently defining when the player has won. I currently have:

    let playerWon = gameOver.and(curBoard.derive((curBoard) => {
      return isCorrectSelection(
        expectedBoard,
        curBoard.toJS()
      );
    }))

    But I think I'm missing something cause it's not working...

    Will Mruzek
    @mruzekw
    Actually it might be working, one sec please
    Will Mruzek
    @mruzekw

    It was actually working. Had something wrong in my view code.

    I wondered if anyone would be willing to take a look at it. I'm especially curious about my use of setTimeout() and if that's the way to go

    David Sheldrick
    @ds300
    I'll take a look tomorrow :+1: