Echo JS 0.11.0

<~>

tracker1 comments

tracker1 2139 days ago. link 1 point
In most of my projects, I compose a "base.js" that brings in settings and environment configuration. It attaches to a global of __BASE__ … I then have another base.js inside my project that maps and exports portions out of __BASE__ for other portions of my project to use. This way I can test those pieces separately and __BASE__ is never part of my source maps.

I have a separate config/settings project that composes yaml files for deployment(s) into configuration JSON ... this is combined server-side to response to a request for `/base.js` which injects the appropriate values for the application as loaded.
tracker1 2139 days ago. link 1 point
fetch... if your browser isn't at least es2017 (async function support), you're dead to me.
tracker1 2141 days ago. link 2 points
Been using the redux hooks for a project, and really been enjoying it.  My actions modules are exposing a default useActions that wraps useReducer, useMemo and bindActions which keeps the action bindings with the actions instead of each component, which has been really nice.

    import { useMemo } from 'react';
    import { bindActionCreators } from 'redux';
    import { useDispatch } from 'react-redux';
    ...
    const doSomething = (input) => ({ type: 'sometype', ... });
    ...
    ...
    export default deps => {
      const dispatch = useDispatch();
      return useMemo(
        () =>
          bindActionCreators(
            {
              doSomething,
              ...
            },
            dispatch
          ),
        deps ? [dispatch, ...deps] : [dispatch]
      );
    };
tracker1 2144 days ago. link 1 point
Haven't played with it, but looks like a decent, well rounded component suite.
tracker1 2147 days ago. link 1 point
Don't use the className like this... use a ref, it's what they're there for.  Or you can at least use the event's target attribute...

    playAudio(e) {
      e.target.parentNode.getElementsByTagName("audio")[0].play()
    }
tracker1 2152 days ago. link 1 point
Well, from the "story" that you did post, that kind of content does not have a place on this site.
[more]