Common shared app components for desktop and mobile
40ae42c5f6
Rebased from LBRY/lbry-app PR# 1304 with corrections requested by Codacy (Though may still complain regarding spacing). This just makes the code for finding documents a lot easier. the regex patterns and the media type are converted into keypairs, [regex, mediatype] which is then reduced to a single value, which will either be the original filename if there are no matching extensions, or the mediatype. So long as the mediatype does not contain an extension at the end of the string, this system should work far more simply. This will also allow for easier addition of new extensions to the function, so long as they all follow the same pattern for the regex: ^ = Start of string .+ = 1 or more characters of any type . = A literal dot (a|b|c) = A list of ORed extensions within a capture group '( )' $ = End of string, so it is certain this is the actual extension of the filename Won't be hard to add things like Archives, Executables, etc with just a single extra line now. |
||
---|---|---|
build | ||
src | ||
.eslintrc.json | ||
.gitignore | ||
.lintstagedrc | ||
.prettierrc.json | ||
LICENSE | ||
package.json | ||
README.md | ||
webpack.config.js |
lbry-redux
lbry-redux is a module which contains common React and redux code shared between lbry-app and lbry-android.
Installation
Add lbry-redux
as a dependency to your package.json
file.
"lbry-redux": "lbryio/lbry-redux"
Local development
If you intend to make changes to the module and test immediately, you can use npm link
to add the package to your node_modules
folder. This will create a symlink to the folder where lbry-redux
was cloned to.
cd lbry-redux
sudo npm link
cd /<path>/<to>/<project>/node_modules
npm link lbry-redux
Build
Run $ npm build
.