Better HN
topnewbestaskshowjobs
Log inSign up

willriker

6 karma · joined Nov 15, 2016 (10y ago) · 8 submissions

Submissions

1.

How secure are your web application’s open source dependencies?(blog.logrocket.com ↗)

1 points · by willriker · 8y ago · discuss

2.

How CSS works: Creating layers with z-index(blog.logrocket.com ↗)

2 points · by willriker · 8y ago · discuss

3.

How CSS works: Parsing and painting CSS in the critical rendering path(blog.logrocket.com ↗)

1 points · by willriker · 8y ago · discuss

comment 8y ago · link · parent

I believe they are both classified as analytics tools which is why they are blocked. It's annoying that uMatrix will still block a tool even if you purposefully navigate to their site (versus if the tool is used for analytics on a different company's site).

5.

Front end development in 2017 (year in review)(blog.logrocket.com ↗)

1 points · by willriker · 8y ago · discuss

comment 9y ago · link · parent

Another benefit of redux-saga not mentioned here is the ability to build stateful sagas. For example, something like a game loop can be encoded in a saga like this:

export default function* playGame({ getState, selectors }) { yield take(GAME_READY);

  const refreshDelay = 1000 / FPS;

  while (true) { 
    yield take(START_GAME_PLAY);

    while (true) { 
      const {
        gameState: {
          speed,
          isPlaying,
          gameTime,
        },
      } = getState();

      if (!isPlaying) {
        // game play has stopped
        break;
      }

      const timeDelta = refreshDelay * speed;
      yield put(setGameTime(gameTime + timeDelta));

      // sleep
      yield call(delay, refreshDelay);
    }
  }
}

comment 9y ago · link · parent

One key advantage of redux-saga is testability-- since sagas are essentially functions with their arguments passed in by the saga middleware, it is easy to inject mocked dependencies in a test environment.