This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useRef } from 'react'; | |
export default () => { | |
const isMounted = useRef(null); | |
useEffect(() => { | |
isMounted.current = true; | |
return () => { isMounted.current = false; }; | |
}, []); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// eslint-disable-next-line import/no-mutable-exports,prefer-const | |
export let baseUrl = process.env.REACT_APP_API_DOMAIN; | |
export const constructUrl = (path, queryParams = null) => { | |
const _url = new URL(baseUrl); | |
_url.pathname = path; | |
if (queryParams) _url.search = new URLSearchParams(queryParams).toString(); | |
return _url.toString(); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useEffect, useState} from 'react'; | |
const getWindowDimensions = () => { | |
const {innerWidth: width, innerHeight: height} = window; | |
return { | |
width, | |
height | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Torch.Templates do | |
@moduledoc """ | |
Module allowing to automatically manage templates depending of the given mix task | |
""" | |
@template_path "priv/templates" | |
def inject_templates(mix_task, options) do | |
out_directory = Keyword.get(options, :out_directory, "#{@template_path}/#{mix_task}") |
OlderNewer