Skip to content

Instantly share code, notes, and snippets.

View Matthew-Burfield's full-sized avatar
🏠
Working from home

Matthew Burfield Matthew-Burfield

🏠
Working from home
View GitHub Profile
@Matthew-Burfield
Matthew-Burfield / remove-immutable.md
Created May 10, 2023 06:44 — forked from guilhermebruzzi/remove-immutable.md
Remove Immutable JS from your source code

I decided to remove all Immutable code on our big project because it wasn't causing our React to render less (using selectors on our redux layer was actually better).

Since our project has tests to check if everything is still working, I was able to achieve that with the following steps:

Search on all files on vscode or any editor with Use Regular Expression option (command+alt+r on vscode):

(Immutable|\.(size|count\(|toJS(?!\w)|fromJS(?!\w)|first[\(\)]|get\(|set\(|findEntry\(|getIn\(|setIn\(|contains\(|delete\(|asImmutable|add\())

Then on each find that was actually from a Immutable code:

  • Remove Immutable imports
@Matthew-Burfield
Matthew-Burfield / imgur.js
Created April 25, 2017 11:53 — forked from cecilemuller/imgur.js
Search images using the Imgur API
'use strict';
/* global XMLHttpRequest */
/* global process.env.API_IMGUR */
const querystring = require('querystring');
/**
* Fetches a page of results from the Imgur API.
*
* @param {String} options.q Query