{"_id":"@5rabbits/mobx-rest","_rev":"10-6a885628d35d463d44e65b7187d4512c","name":"@5rabbits/mobx-rest","dist-tags":{"latest":"3.1.4"},"versions":{"3.0.0":{"name":"@5rabbits/mobx-rest","version":"3.0.0","description":"REST conventions for mobx.","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"publishConfig":{"access":"public"},"license":"MIT","jest":{"collectCoverage":true,"coverageReporters":["json","lcov","text-summary","html"],"testRegex":"/__tests__/.*\\.spec\\.js$","collectCoverageFrom":["src/**/*.js"]},"standard":{"parser":"babel-eslint","globals":["it","describe","beforeEach","expect","Class","jest"]},"dependencies":{"deepmerge":"^2.0.0","lodash":"^4.17.4"},"peerDependencies":{"mobx":"^3.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^22.1.0","babel-plugin-lodash":"^3.3.2","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-1":"^6.24.1","babel-register":"^6.24.1","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-flowtype":"2.34.0","eslint-plugin-import":"^2.3.0","eslint-plugin-node":"^5.0.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","flow-bin":"^0.47.0","flow-copy-source":"^1.1.0","husky":"^0.13.4","jest":"^22.1.3","lint-staged":"^3.6.0","mobx":"^3.2.0","prettier-standard":"^5.0.0","rimraf":"^2.6.1"},"main":"lib","scripts":{"build:clean":"rimraf lib","build:lib":"babel -d lib src --ignore '**/__tests__/**'","build:flow":"flow-copy-source -v -i '**/__tests__/**' src lib","build":"npm run build:clean && npm run build:lib && npm run build:flow","prepublish":"npm run build","jest":"BABEL_ENV=test NODE_PATH=src jest --no-cache","lint":"eslint --ext .jsx,.js --cache src/ __tests__/","flow":"flow","test":"npm run flow && npm run lint && npm run jest","format":"prettier-standard --print-width 60 \"{src,__tests__}/**/*.js\"","prepush":"npm test"},"gitHead":"acfc75d796772cc7d99a7dd2e8c94234e2e3cc96","bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"homepage":"https://github.com/masylum/mobx-rest#readme","_id":"@5rabbits/mobx-rest@3.0.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rdiaz","email":"rdiazv89@gmail.com"},"dist":{"integrity":"sha512-Bfx/J8HY2oygBuhouy4dhSoXMOGBvq5L8/W2v9dn5P+MEqjTwEgi10ydxvzJjJ8H2G7sfApz08aZQeo5z6pvxw==","shasum":"41076d1cfd5cd942e8f4e2ba18e2fff7f44c2e26","tarball":"https://registry.npmjs.org/@5rabbits/mobx-rest/-/mobx-rest-3.0.0.tgz","fileCount":67,"unpackedSize":629742,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAKhzKLotXLdMLw3TMGjCBdd15zTRcaD3BYEUsR88uDxAiEA1jJM/ezWNLK81RSfoDLT6y4R8OHMjmdE9qcj/Sjahek="}]},"maintainers":[{"name":"lemontech","email":"5rabbits@lemontech.com"},{"name":"rdiaz","email":"rdiazv89@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobx-rest_3.0.0_1523547599629_0.17738770812470883"},"_hasShrinkwrap":false},"3.1.0":{"name":"@5rabbits/mobx-rest","version":"3.1.0","description":"REST conventions for mobx.","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"publishConfig":{"access":"public"},"license":"MIT","jest":{"collectCoverage":true,"coverageReporters":["json","lcov","text-summary","html"],"testRegex":"/__tests__/.*\\.spec\\.js$","collectCoverageFrom":["src/**/*.js"]},"standard":{"parser":"babel-eslint","globals":["it","describe","beforeEach","expect","Class","jest"]},"dependencies":{"deepmerge":"^2.0.0","lodash":"^4.17.4"},"peerDependencies":{"mobx":"^3.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^22.1.0","babel-plugin-lodash":"^3.3.2","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-1":"^6.24.1","babel-register":"^6.24.1","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-flowtype":"2.34.0","eslint-plugin-import":"^2.3.0","eslint-plugin-node":"^5.0.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","flow-bin":"^0.47.0","flow-copy-source":"^1.1.0","husky":"^0.13.4","jest":"^22.1.3","lint-staged":"^3.6.0","mobx":"^3.2.0","prettier-standard":"^5.0.0","rimraf":"^2.6.1"},"main":"lib","scripts":{"build:clean":"rimraf lib","build:lib":"babel -d lib src --ignore '**/__tests__/**'","build:flow":"flow-copy-source -v -i '**/__tests__/**' src lib","build":"npm run build:clean && npm run build:lib && npm run build:flow","prepublish":"npm run build","jest":"BABEL_ENV=test NODE_PATH=src jest --no-cache","lint":"eslint --ext .jsx,.js --cache src/ __tests__/","flow":"flow","test":"npm run flow && npm run lint && npm run jest","format":"prettier-standard --print-width 60 \"{src,__tests__}/**/*.js\"","prepush":"npm test"},"gitHead":"b4c1e828528ffd5d58e315d1666bb942899fcb79","bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"homepage":"https://github.com/masylum/mobx-rest#readme","_id":"@5rabbits/mobx-rest@3.1.0","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rdiaz","email":"rdiazv89@gmail.com"},"dist":{"integrity":"sha512-SEdZowj7PtFw5KODZssug32bo3jM9ZaMGHH4+9rsnjRdQ3zSa0S6ParmUzwZJG7WAl7AsR8h0CSP1Ti+JTWTDw==","shasum":"d7a6218c9e01e88f8a48cf8240fe28c93ea0d049","tarball":"https://registry.npmjs.org/@5rabbits/mobx-rest/-/mobx-rest-3.1.0.tgz","fileCount":67,"unpackedSize":627900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbQ9syCRA9TVsSAnZWagAARFoQAI/ph/wDiYIHWOjdsFm2\nw8oZZkNA5wMT94owojtGD0SkO3ghRbnTm7EpmziCyuh/g2A9//FCqWM+IHnW\n8Z7NKL0XxJvShXK/Fzsvqd2Hj+k2q+PKrnb9CNDsQuDHnnc31/WgBljkxkid\nZai4uHeBlFQZeyOpdSvDIRIyEfegIbpQuzaZRCoF9iPmW3s1HjXUGSdm3DWg\ncmOTeyVwMKzgE4ql0ZkPBRH1ggy6+7qT0SsIkyEXgkJrVpy4WDgqBw3y9jZz\nnmpe/FGPJY9YblwMtK5LrzkYULNwLl/52FTQnYkepsHQ4hom7d2gi3a93rtx\n0FNBRVIl4zS3kRL/D94pm1nqa0DCYqlKvO8esjkb6+y9USTja9ijE8ovFO1C\npGR3fk4i/3s6tNvHrBqjVphksy3iSTEy8j5/UUwrJdcGZyj8dFZWLlybQYKF\noyQD8uHruBlJiS/krG6d3YpW2ggjVwA5v51iHtc6njx0GSihI5Gwhwx5Acbr\n4tHVH2RpqepZE6bHvao1f5SKntD5sVVj3OlPpZoJ00yn+MkM6kyVsL459zd8\n2HLUJ01jBdfC3ppIC+/quTq8+73dEKoQD959IwZlYz0xKRHF3OT8+3ClHCcz\n2SdhHWr8KlymRwTVfE+cfzndfhjwKdivVLNUeyUVLXorHAbrU+y3f+bLgvFl\nJuz/\r\n=pdog\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAvBRvJGmoP9RJQmjkksTvis/Z1u59SmNKM/TIrvGgWQIhAPYbB4G7WR/O7zqE8LeDQez0VeOr6z1s/6d6wcQNWfzu"}]},"maintainers":[{"email":"dochoajohn@gmail.com","name":"dochoaj"},{"email":"glara@glara.cl","name":"glara"},{"email":"5rabbits@lemontech.com","name":"lemontech"},{"email":"rdiazv89@gmail.com","name":"rdiaz"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobx-rest_3.1.0_1531173682923_0.3508581747919768"},"_hasShrinkwrap":false},"3.1.1":{"name":"@5rabbits/mobx-rest","version":"3.1.1","description":"REST conventions for mobx.","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"publishConfig":{"access":"public"},"license":"MIT","jest":{"collectCoverage":true,"coverageReporters":["json","lcov","text-summary","html"],"testRegex":"/__tests__/.*\\.spec\\.js$","collectCoverageFrom":["src/**/*.js"]},"standard":{"parser":"babel-eslint","globals":["it","describe","beforeEach","expect","Class","jest"]},"dependencies":{"deepmerge":"^2.0.0","lodash":"^4.17.4"},"peerDependencies":{"mobx":"^3.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^22.1.0","babel-plugin-lodash":"^3.3.2","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-1":"^6.24.1","babel-register":"^6.24.1","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-flowtype":"2.34.0","eslint-plugin-import":"^2.3.0","eslint-plugin-node":"^5.0.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","flow-bin":"^0.47.0","flow-copy-source":"^1.1.0","husky":"^0.13.4","jest":"^22.1.3","lint-staged":"^3.6.0","mobx":"^3.2.0","prettier-standard":"^5.0.0","rimraf":"^2.6.1"},"main":"lib","scripts":{"build:clean":"rimraf lib","build:lib":"babel -d lib src --ignore '**/__tests__/**'","build:flow":"flow-copy-source -v -i '**/__tests__/**' src lib","build":"npm run build:clean && npm run build:lib && npm run build:flow","prepublish":"npm run build","jest":"BABEL_ENV=test NODE_PATH=src jest --no-cache","lint":"eslint --ext .jsx,.js --cache src/ __tests__/","flow":"flow","test":"npm run flow && npm run lint && npm run jest","format":"prettier-standard --print-width 60 \"{src,__tests__}/**/*.js\"","prepush":"npm test"},"gitHead":"4359660a18fe99beff47c70da711c7a7270de902","bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"homepage":"https://github.com/masylum/mobx-rest#readme","_id":"@5rabbits/mobx-rest@3.1.1","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rdiaz","email":"rdiazv89@gmail.com"},"dist":{"integrity":"sha512-1v911JjpLsqcRqO5tPteoR4vi0Cd6/sEXEUu9nQJfh63V21cYu0LWLqDPKLKJKJVg5v3KBsgqLRXGzMvB0pgNg==","shasum":"24d704cd9cbe2421f0945e74cc5bc42850a18744","tarball":"https://registry.npmjs.org/@5rabbits/mobx-rest/-/mobx-rest-3.1.1.tgz","fileCount":67,"unpackedSize":556436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbX0oxCRA9TVsSAnZWagAAi9EP/22cGlHbKWpcqTZSmsAB\nb9uqx1tlP+mS4MFLUPbwjkqJ5pYwnp3YmmYxattxB2YpkINxkyMge+O0uNnf\nG7PDPtLe5H+cgDvnRJAYvBwNP5+U3AQAITjbtFzxux85r/mZJjpXkJRHov4g\nIhCJxcP1edw8PiyqsBOpL5xPPeDuYeB8OSgDYnrxWNmQtZPHsUtUdRShpveU\nU83i14Pw4vPRCWXN/5DRVu2SJyiNHnMMr8lsG17Yk4YPTYk6M/iy1Y0zdm2u\nmCE9tqrX/Yzq+SM0hsdxfFMra8P/Zq8WTHREgOrrlddxysVYClpo7u+GGFMP\nLFbK2L78XAczF3QMonYNpGSqjvwkWt1VXYKlHxS2MgpDSw2WLWdV0QsKArWt\nlwWOticM5gfUPex5xGl5DXHC6M7gZIzj0KdB4QostwUTex6ra5Atupg03SxG\nuLEsIep+5Ou7Z/5324zK354sLmL7PFdN01yh7FhXlYJUeded3c/gurU9RnzS\n36u3sxlO4p2/e+1EvjMRk8xw9FMK7pxZ4MPwrMNRtgigTDJ8wBC3Gk9m3oRL\nlA/ZaXMX0peeSn6dcgGJVM+igzjvgJVqtO6/gnFSgUkyz1zb3NUp8GWA3yip\nwtBwa/V5MbU843bGhrU2/PCJQxFndlIYLceEGcBjPcJvu6V3tg0/6OSQyDN7\nlhxl\r\n=9pHv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG3ouQ89lLuEsrSoOqoc2OsqP1sP6OfQfciH3Sj0XtDFAiEAq4GUpmxOVzSC5d+Mewozfn6LLIvtthy2pxUwqv/PrA4="}]},"maintainers":[{"email":"dochoajohn@gmail.com","name":"dochoaj"},{"email":"glara@glara.cl","name":"glara"},{"email":"5rabbits@lemontech.com","name":"lemontech"},{"email":"rdiazv89@gmail.com","name":"rdiaz"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobx-rest_3.1.1_1532971569644_0.25002313722359504"},"_hasShrinkwrap":false},"3.1.2":{"name":"@5rabbits/mobx-rest","version":"3.1.2","description":"REST conventions for mobx.","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"publishConfig":{"access":"public"},"license":"MIT","jest":{"collectCoverage":true,"coverageReporters":["json","lcov","text-summary","html"],"testRegex":"/__tests__/.*\\.spec\\.js$","collectCoverageFrom":["src/**/*.js"]},"standard":{"parser":"babel-eslint","globals":["it","describe","beforeEach","expect","Class","jest"]},"dependencies":{"deepmerge":"^2.0.0","lodash":"^4.17.4"},"peerDependencies":{"mobx":"^3.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^22.1.0","babel-plugin-lodash":"^3.3.2","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-1":"^6.24.1","babel-register":"^6.24.1","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-flowtype":"2.34.0","eslint-plugin-import":"^2.3.0","eslint-plugin-node":"^5.0.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","flow-bin":"^0.47.0","flow-copy-source":"^1.1.0","husky":"^0.13.4","jest":"^22.1.3","lint-staged":"^3.6.0","mobx":"^3.2.0","prettier-standard":"^5.0.0","rimraf":"^2.6.1"},"main":"lib","scripts":{"build:clean":"rimraf lib","build:lib":"babel -d lib src --ignore '**/__tests__/**'","build:flow":"flow-copy-source -v -i '**/__tests__/**' src lib","build":"npm run build:clean && npm run build:lib && npm run build:flow","prepublish":"npm run build","jest":"BABEL_ENV=test NODE_PATH=src jest --no-cache","lint":"eslint --ext .jsx,.js --cache src/ __tests__/","flow":"flow","test":"npm run flow && npm run lint && npm run jest","format":"prettier-standard --print-width 60 \"{src,__tests__}/**/*.js\"","prepush":"npm test"},"gitHead":"65ac180cdd4362bc3d8a03e8c0ca75e071e3bf84","bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"homepage":"https://github.com/masylum/mobx-rest#readme","_id":"@5rabbits/mobx-rest@3.1.2","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rdiaz","email":"rdiazv89@gmail.com"},"dist":{"integrity":"sha512-r0rBwRbD4YTO89854GCunsoy/Eb2dHy51lYMvRt4RAk4XmCV2nqnNfvvQ1Y8lPxIrIxq7xrEvWSZ91mSZQs6KQ==","shasum":"43b40ef7d5b8a17a79699673e64bd868b25e192f","tarball":"https://registry.npmjs.org/@5rabbits/mobx-rest/-/mobx-rest-3.1.2.tgz","fileCount":67,"unpackedSize":629389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYZwECRA9TVsSAnZWagAAhQ8P/09Tye1clYrKmHaTuuI2\n9JDnru5mJw0BPSmtiilbita7MEQFUVf/h1qSwQVUYGB9od8jpEK49K5i//G9\nARlcB45MRwc0sPia1DYn5J0NUaSGBgJ7lY3r3IhYAfQJ8Q2OQZB1wc8fr6I7\nDOWFLtS7SQlZZGxYw3TB87LeyS4mVoONqYJ5UKo0r699vKNfT8QagB3iBg5A\nzJ9OJLwFr507XjquJuk7mEkB0yb6bTTMSZw35WeNjmAkmjwwxvKt5lGHcq0q\nBVRuIFOyEZCd9I3Hq6UHzbguygS4RvZZvJVcRCc43reUQqOey8qG0JzVzbkJ\nUCGG0GKUSQzjw7KTb+wbsrHvFutr/3Go3hZbxfL14vGAja5ujyklO9akhb+/\n8RjI8LY9Z8vwGgztLsGBLfEHH0GVceTfc35EbuEj1q1mW7+1Y8Ka4xTQYVBR\nByCsbMVuPZVoY8VEqX7KStX5idEaS7HK7vWKinyxSpnuhMdLp08ihQmBnVCl\nDWxfpncS5hmQXkx1QgTxzbYtIckQpkiL4WabaIHoeQ7su/BH/HTtZEV056+P\nliEIdCSg6btyFz0gINzLUN2356Io1fV454t3hKGEquXcD18S+hHJtRYrG2kO\nXk+KLBySz3kHYzQyrHOJD0CtyaSyVB1/a8CCX0dtD3jBAUCg0BGRXC9J0ByR\nz8zs\r\n=9SjS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5ysahajBAk1c/bKWaNOdHOYBoklrfx3RJ2Ufj9rZBzgIgAQk6+s0IlfI1f5fMNdpPx/KWI/dkhgv2t4HdQMbnVlo="}]},"maintainers":[{"email":"dochoajohn@gmail.com","name":"dochoaj"},{"email":"glara@glara.cl","name":"glara"},{"email":"5rabbits@lemontech.com","name":"lemontech"},{"email":"rdiazv89@gmail.com","name":"rdiaz"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobx-rest_3.1.2_1549900803975_0.9217288524576652"},"_hasShrinkwrap":false},"3.1.3":{"name":"@5rabbits/mobx-rest","version":"3.1.3","description":"REST conventions for mobx.","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"publishConfig":{"access":"public"},"license":"MIT","jest":{"collectCoverage":true,"coverageReporters":["json","lcov","text-summary","html"],"testRegex":"/__tests__/.*\\.spec\\.js$","collectCoverageFrom":["src/**/*.js"]},"standard":{"parser":"babel-eslint","globals":["it","describe","beforeEach","expect","Class","jest"]},"dependencies":{"deepmerge":"^2.0.0","lodash":"^4.17.4"},"peerDependencies":{"mobx":"^3.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^22.1.0","babel-plugin-lodash":"^3.3.2","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-1":"^6.24.1","babel-register":"^6.24.1","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-flowtype":"2.34.0","eslint-plugin-import":"^2.3.0","eslint-plugin-node":"^5.0.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","flow-bin":"^0.47.0","flow-copy-source":"^1.1.0","husky":"^0.13.4","jest":"^22.1.3","lint-staged":"^3.6.0","mobx":"^3.2.0","prettier-standard":"^5.0.0","rimraf":"^2.6.1"},"main":"lib","scripts":{"build:clean":"rimraf lib","build:lib":"babel -d lib src --ignore '**/__tests__/**'","build:flow":"flow-copy-source -v -i '**/__tests__/**' src lib","build":"npm run build:clean && npm run build:lib && npm run build:flow","prepublish":"npm run build","jest":"BABEL_ENV=test NODE_PATH=src jest --no-cache","lint":"eslint --ext .jsx,.js --cache src/ __tests__/","flow":"flow","test":"npm run flow && npm run lint && npm run jest","format":"prettier-standard --print-width 60 \"{src,__tests__}/**/*.js\"","prepush":"npm test"},"gitHead":"14cb351d68454d1fb559c79fa9cc2526fd6de594","bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"homepage":"https://github.com/masylum/mobx-rest#readme","_id":"@5rabbits/mobx-rest@3.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rdiaz","email":"rdiazv89@gmail.com"},"dist":{"integrity":"sha512-sj5rm1IhziPE+FkifLG77ZpG7Ww0tjJy1z6VDxTQ8vo9aXip4tl6Neq3KkuDYze4wl8Z2E0hCufSgXIcqiZJFQ==","shasum":"67071ab8ed1d282e340d9562546be6da5f1c4f4a","tarball":"https://registry.npmjs.org/@5rabbits/mobx-rest/-/mobx-rest-3.1.3.tgz","fileCount":68,"unpackedSize":632109,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYZ1fCRA9TVsSAnZWagAAOZ4QAJA20HMykprH1WD1OpoH\nN8aSi+LBt2mpinWaIKHwHXufrA8mPU86NM0nblV7b69RQ69PDzbMEUmEoXo5\nvGnUk9zmdgZGYpnRnnE5cb/7FyqP3CKicIpycLtqQFdYNjCb3Vg5P9+V0Wou\nGaL0F5ALwtIm9E2bzdPYx+eAjaC+cU5XMG4xPFKghuQcGV/Wx5Mrr1cieWa6\nBjp65UkCaRzcCgaD4SnKPyp86Ys5f4fC+PqKVLeb1OGMUcxYF6U69eDqichx\nHPrE1TfAZ+TEIGeH8ScDGro3lz34LZDaNnKOwrFrwG57EoajmJoEYqLI4/8n\ndO9XG5OvzMq7R+TjqgH9SfY/Um1dfS2Phhq/RpYN1FWJyvqIu8T7sajwtztE\nz+jo1IHd4BiAWJa0vEZHBolYhbEQI3O2uxXTjrT5TiSlePuWu2Ree4wgyHPA\nS0sjNl4aaSVtKX3hcvP1yN9eU95Hz+m5um5S/veXSQgnmXLgQKkHeWVXq0D8\n60+aCkZc+IPU+vPGjo2Fwb0e7aa2pkUdyUKJ2+9PiErLfxQxNBWxxJ4ARTOT\n7eu4Pmxwa/nN/Smd/TKgtXBYalcHWCXQFvmS+GBdMKY9XBtOkma6jFvwtN3t\n+0OuHur1yzRDFP64bLYk9S4vUmb5J9pj52e99RPRIuVDUhX2mIA8jUCBfKdz\nfOYK\r\n=ci+K\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/geV655jvxvmdvYFE9W3X8ohOGDpGwVxeZs8wPh2ynQIhANxFAYe64Z6fCokCVofCeTk3ftjjseLbU9BqTTf8BLog"}]},"maintainers":[{"email":"dochoajohn@gmail.com","name":"dochoaj"},{"email":"glara@glara.cl","name":"glara"},{"email":"5rabbits@lemontech.com","name":"lemontech"},{"email":"rdiazv89@gmail.com","name":"rdiaz"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobx-rest_3.1.3_1549901150427_0.9845254078557155"},"_hasShrinkwrap":false},"3.1.4":{"name":"@5rabbits/mobx-rest","version":"3.1.4","description":"REST conventions for mobx.","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"publishConfig":{"access":"public"},"license":"MIT","jest":{"collectCoverage":true,"coverageReporters":["json","lcov","text-summary","html"],"testRegex":"/__tests__/.*\\.spec\\.js$","collectCoverageFrom":["src/**/*.js"]},"standard":{"parser":"babel-eslint","globals":["it","describe","beforeEach","expect","Class","jest"]},"dependencies":{"deepmerge":"^2.0.0","lodash":"^4.17.4"},"peerDependencies":{"mobx":"^3.2.0"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-eslint":"^7.2.3","babel-jest":"^22.1.0","babel-plugin-lodash":"^3.3.2","babel-plugin-transform-async-to-generator":"^6.24.1","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.22.0","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.23.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-1":"^6.24.1","babel-register":"^6.24.1","eslint":"^3.19.0","eslint-config-standard":"^10.2.1","eslint-plugin-flowtype":"2.34.0","eslint-plugin-import":"^2.3.0","eslint-plugin-node":"^5.0.0","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","flow-bin":"^0.47.0","flow-copy-source":"^1.1.0","husky":"^0.13.4","jest":"^22.1.3","lint-staged":"^3.6.0","mobx":"^3.2.0","prettier-standard":"^5.0.0","rimraf":"^2.6.1"},"main":"lib","scripts":{"build:clean":"rimraf lib","build:lib":"babel -d lib src --ignore '**/__tests__/**'","build:flow":"flow-copy-source -v -i '**/__tests__/**' src lib","build":"npm run build:clean && npm run build:lib && npm run build:flow","prepublish":"npm run build","jest":"BABEL_ENV=test NODE_PATH=src jest --no-cache","lint":"eslint --ext .jsx,.js --cache src/ __tests__/","flow":"flow","test":"npm run flow && npm run lint && npm run jest","format":"prettier-standard --print-width 60 \"{src,__tests__}/**/*.js\"","prepush":"npm test"},"gitHead":"428dc09015bc1e9957154d01df8bc55a46eee0a6","bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"homepage":"https://github.com/masylum/mobx-rest#readme","_id":"@5rabbits/mobx-rest@3.1.4","_npmVersion":"5.6.0","_nodeVersion":"8.11.1","_npmUser":{"name":"rdiaz","email":"rdiazv89@gmail.com"},"dist":{"integrity":"sha512-dko71nvbtxtlIK7rOO72MLz6z4qLK0hnzVx8ZVXo53XGzs/i60NyipNa+w2nlvxxFILW71Gby2f/PhFzXcr5/A==","shasum":"5d25db37b5a4147e13b93e36a23875fb23143f36","tarball":"https://registry.npmjs.org/@5rabbits/mobx-rest/-/mobx-rest-3.1.4.tgz","fileCount":68,"unpackedSize":636909,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcYu1LCRA9TVsSAnZWagAA/qEP/RJo8QzzxwD10V45J05j\nionOLnmOVjwiUhxxy5x1prTL+t54COlzq4pCO+AwpHrwtx3hFOSjIL3RZs/I\n57zUENKPeYX3TOP22cyjSl1ijHeOc11a9IsN+mf2wx/tqLAcDKkeLl0EzsIV\nTJ/pvAunyfuPpEEKIki8dVntUuZXHMDdynB+lbJny53RwUzCXwYv7Ek7gSo6\n4wh/va7qjO9x+1vcwqFNVD1zBsTRrmAXnzS4zXfFfDkIFq3/wfftPyodJQD4\nCIEGU9JgqOZhg6rmjzqMaZ+xfqhKysx1gwl0uzcHLsdgbzknQmV0cZ4zZ5nw\nJvxShX79cd3xQJNgRt8gherdjlIKYolQW69+5WW5KoxmZW+FCYbn2TJVruWb\nwyJPGFL/NkDtv8yANmHyFSxY1LPziqSlz3Eqqdlg19a8+KyyH2l1s52skyAY\nUAb4Vk/jSwJPeUrPBecfUFM/qjqXjak1VeuSAa0oRO6YA8f3fcErh++vAbXy\nHmxuWP9YkxS3jZxvhwgyAKTt9OREWRn22fsCocvMRs/hU3VPE8oBUx+3UocU\nNKuIJZO24UAe92kFGfCZXhthbExFg1yQTMwg85w8BGxHGE4NN5ut1LJooSCr\nlwmTQr83X1aNWH3eUNqaTjz2kJ9F8P+ksOPJkWip/LWvdv4DhSIW7ynNSQVm\nDs6l\r\n=NEGE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDvLpIvUGBPGm9icvrYKuU75AIygVUAEQA9M954SukGrAIgaq2eFga+bFtBBddNbWBdnSJDkDTRsbNRsZhefR8x6ns="}]},"maintainers":[{"email":"dochoajohn@gmail.com","name":"dochoaj"},{"email":"glara@glara.cl","name":"glara"},{"email":"5rabbits@lemontech.com","name":"lemontech"},{"email":"rdiazv89@gmail.com","name":"rdiaz"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mobx-rest_3.1.4_1549987146156_0.9554505636619137"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-12T15:39:59.573Z","3.0.0":"2018-04-12T15:39:59.704Z","modified":"2022-04-04T10:48:39.026Z","3.1.0":"2018-07-09T22:01:22.983Z","3.1.1":"2018-07-30T17:26:09.737Z","3.1.2":"2019-02-11T16:00:04.130Z","3.1.3":"2019-02-11T16:05:50.568Z","3.1.4":"2019-02-12T15:59:06.285Z"},"maintainers":[{"email":"infra@lemontech.com","name":"lemonlet"},{"email":"glara@glara.cl","name":"glara"},{"email":"rdiazv89@gmail.com","name":"rdiaz"}],"description":"REST conventions for mobx.","homepage":"https://github.com/masylum/mobx-rest#readme","repository":{"type":"git","url":"git+ssh://git@github.com/masylum/mobx-rest.git"},"bugs":{"url":"https://github.com/masylum/mobx-rest/issues"},"license":"MIT","readme":"# mobx-rest\n\nREST conventions for mobx.\n\n[![Build Status](https://travis-ci.org/masylum/mobx-rest.svg?branch=master)](https://travis-ci.org/masylum/mobx-rest)\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](http://standardjs.com)\n\n![](https://media.giphy.com/media/b9QBHfcNpvqDK/giphy.gif)\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [What is it?](#what-is-it)\n- [Full React example](#full-react-example)\n- [Documentation](#documentation)\n  - [Model](#model)\n  - [Collection](#collection)\n  - [apiClient](#apiclient)\n- [Simple Example](#simple-example)\n- [State shape](#state-shape)\n- [FAQ](#faq)\n- [Where is it used?](#where-is-it-used)\n- [License](#license)\n\n## Installation\n\n```\nnpm install mobx-rest --save\n```\n\n## What is it?\n\nAn application state is usually divided into three realms:\n\n  - **Component state**: Each state can have their own state, like a button\n  being pressed, a text input value, etc.\n  - **Application state**: Sometimes we need components to share state between them and\n  they are too far away to actually make them talk each other through props.\n  - **Resources state**: Other times, state is persisted in the server. We synchronize\n  that state through APIs that consume *resources*. One way to synchronize this state\n  is through REST.\n\nMobX is an excellent state management choice to deal with those three realms:\nIt allows you to represent your state as a graph while other solutions,\nlike Redux for instance, force you to represent your state as a tree.\n\nWith `mobx-rest` resources are implemented with all their REST\nactions built in (`create`, `fetch`, `save`, `destroy`, ...) so instead\nof writing, over and over, hundreds of lines of boilerplate we can leverage\nREST conventions to minimize the code needed for your API interactions.\n\n## Full React example\n\nIf you want to see a full example with React you\ncan check out the [mobx-rest-example repo](https://github.com/masylum/mobx-rest-example).\nThe demo is deployed [here](https://demo-wiimsnkpdy.now.sh/).\n\n## Documentation\n\n`mobx-rest` is fairly simple and its source code could be read in 5 minutes.\n\n### `Model`\n\nA `Model` represents one resource. It's identified by a primary key (mandatory) and holds\nits attributes. You can create, update and destroy models in the client and then sync\nthem with the server. Apart from its attributes, a `Model` also holds the state of\nthe interactions with the server so you can react to those easily (showing loading states\nfor instance).\n\n#### `constructor(attributes: Object)`\n\nInitialize the model with the given attributes.\n\nYou can also overwrite it to provide default attributes like this:\n\n```js\nclass User extends Model {\n  constructor(attributes) {\n    super(Object.assign({\n      token: null,\n      email_verified: false,\n    }, attributes))\n  }\n}\n```\n\n#### `attributes: ObservableMap`\n\nAn `ObservableMap` that holds the attributes of the model.\n\n#### `collection: ?Collection`\n\nA pointer to a `Collection`. By having models\n\"belong to\" a collection you can take the most out\nof `mobx-rest`.\n\n#### `request`\n\nA `Request` object that represents the state of the ongoing request, if any.\n\n#### `error`\n\nAn `Error` object that represents the state of the failed request, if any.\n\n#### `toJS(): Object`\n\nReturn the object version of the attributes.\n\n#### `primaryKey: string`\n\nImplement this abstract method so `mobx-rest` knows what to\nuse as a primary key. It defaults to `'id'` but if you use\nsomething like mongodb you can change it to `'_id'`.\n\n#### `urlRoot(): string`\n\nImplement this abstract method so `mobx-rest` knows where\nits API points to. If the model belongs to a `Collection`\n(setting the `collection` attribute) this method does\nnot need to be implemented.\n\n#### `url(): string`\n\nReturn the url for that given resource. Will leverage the\ncollection's base url (if any) or `urlRoot`. It uses the\nprimary id since that's REST convention.\n\nExample: `tasks.get(34).url() // => \"/tasks/34\"`\n\n#### `isRequest(label: string): boolean`\n\nHelper method that asks the model whether there is an ongoing\nrequest with the given label.\n\nExample: `file.isRequest('saving')`\n\n#### `isNew: boolean`\n\nReturn whether that model has been synchronized with the server or not.\nResources created in the client side (optimistically) don't have\nan `id` attribute yet (that's given by the server)\n\nExample:\n\n```js\nconst user = new User({ name : 'Pau' })\nuser.isNew // => true\nuser.save()\nuser.isNew // => false\nuser.get('id') // => 1\n```\n\n#### `get(attribute: string): any`\n\nGet the given attribute. If the attribute does not exist, it will throw an error.\n\nIf different resources have different schemas you can\nalways use `has` to check whether a given attribute exists or not.\n\nExample:\n\n```js\nif (user.has('role')) {\n  return user.get('role')\n} else {\n  return 'basic'\n}\n```\n\n#### `has(attribute: string): boolean`\n\nCheck that the given attribute exists.\n\n#### `set(data: Object): void`\n\nUpdate the attributes in the client.\n\nExample:\n\n```js\nconst folder = new Folder({ name : 'Trash' })\nfolder.get('name') // => 'Trash'\nfolder.set({ name: 'Rubbish' })\nfolder.get('name') // => 'Rubbish'\n```\n\n#### `fetch(options): Promise`\n\nRequest this resource's data from the server. It tracks the state\nof the request using the label `fetching` and updates the resource when\nthe data is back from the API.\n\nExample:\n\n```js\nconst task = new Task({ id: 3 })\nconst promise = task.fetch()\ntask.isRequest('fetching') // => true\nawait promise\ntask.get('name') // => 'Do the laundry'\n```\n\n#### `save(attributes: Object, options: Object): Promise`\n\nThe opposite of `fetch`. It takes the resource from the client and\npersists it in the server through the API. It accepts some attributes\nas the first argument so you can use it as a `set` + `save`.\nIt tracks the state of the request using the label `saving`.\n\nOptions:\n\n  - `optimistic = true` Whether we want to update the resource in the client\n  first or wait for the server's response.\n  - `patch = true` Whether we want to use the `PATCH` verb and semantics, sending\n  only the changed attributes instead of the whole resource down the wire.\n\nExample:\n\n```js\nconst company = new Company({ name: 'Teambox' })\nconst promise = company.save({ name: 'Redbooth' }, { optimistic: false })\ncompany.isRequest('saving') // => true\ncompany.get('name') // => 'Teambox'\nawait promise\ncompany.get('name') // => 'Redbooth'\n```\n\n#### `destroy(options: Object): Promise`\n\nTells the API to destroy this resource.\n\nOptions:\n\n  - `optimistic = true` Whether we want to delete the resource in the client\n  first or wait for the server's response.\n\n#### `rpc(method: 'string', body: {}): Promise`\n\nWhen dealing with REST there are always cases when we have some actions beyond\nthe conventions. Those are represented as `rpc` calls and are not opinionated.\n\nExample:\n\n```js\nconst response = await task.rpc('resolveSubtasks', { all: true })\nif (response.ok) {\n  task.subTasks.fetch()\n}\n```\n\n### `Collection`\n\nA `Collection` represents a group of resources. Each element of a `Collection` is a `Model`.\nLikewise, a collection tracks also the state of the interactions with the server so you\ncan react accordingly.\n\n#### `models: ObservableArray`\n\nAn `ObservableArray` that holds the collection of models.\n\n#### `request: ?Request`\n\nA `Request` object that represents the state of the ongoing request, if any.\n\n#### `error: ?ErrorObject`\n\nAn `Error` object that represents the state of the failed request, if any.\n\n#### `constructor(data: Array<Object>)`\n\nInitializes the collection with the given resources.\n\n#### `url(): string`\n\nAbstract method that must be implemented if you want your collection\nand it's models to be able to interact with the API.\n\n#### `model(): Model`\n\nAbstract method that tells which kind of `Model` objects this collection\nholds. This is used, for instance, when doing a `collection.create` so\nwe know which object to instantiate.\n\n#### `toJS(): Array<Object>`\n\nReturn a plain data structure representing the collection of resources\nwithout all the observable layer.\n\n#### `toArray(): Array<ObservableMap>`\n\nReturn an array with the observable resources.\n\n#### `isRequest(label: string): boolean`\n\nHelper method that asks the collection whether there is an ongoing\nrequest with the given label.\n\nExample:\n\n```js\nfilesCollection.isRequest('saving')\n```\n\n#### `isEmpty(): boolean`\n\nHelper method that asks the collection whether there is any\nmodel in it.\n\nExample:\n\n```js\nconst promise = usersCollection.fetch()\nusersCollection.isEmpty() // => true\nawait promise\nusersCollection.isEmpty() // => false\nusersCollection.models.length // => 10\n```\n\n#### `at(index: number): ?Model`\n\nFind a model at the given position.\n\n#### `get(id: number): ?Model`\n\nFind a model (or not) with the given id.\n\n#### `filter(query: Object): Array<Model>`\n\nHelper method that filters the collection by the given conditions represented\nas a key value.\n\nExample:\n\n```js\nconst resolvedTasks = tasksCollection.filter({ resolved: true })\nresolvedTasks.length // => 3\n```\n\n#### `find(query: Object): ?Model`\n\nSame as `filter` but it will halt and return when the first model matches\nthe conditions.\n\nExample:\n\n```js\nconst pau = usersCollection.find({ name: 'pau' })\npau.get('name') // => 'pau'\n```\n\n#### `add(data: Array<Object>): Array<Model>`\n\nAdds models with the given array of attributes.\n\n```js\nusersCollection.add([{id: 1, name: 'foo'}])\n```\n\n#### `reset(data: Array<Object>): Array<Model>`\n\nResets the collection with the given models.\n\n```js\nusersCollection.reset([{id: 1, name: 'foo'}])\n```\n\n#### `remove(ids: Array<number>): void`\n\nRemove any model with the given ids.\n\nExample:\n\n```js\nusersCollection.remove([1, 2, 3])\n```\n\n#### `set(models: Array<Object>, options: Object): void`\n\nMerge the given models smartly the current ones in the collection.\nIt detects what to add, remove and change.\n\nOptions:\n\n  - `add = true` Change to disable adding models\n  - `change = true` Change to disable updating models\n  - `remove = true` Change to disable removing models\n\n```js\nconst companiesCollection = new CompaniesCollection([\n  { id: 1, name: 'Teambox' }\n  { id: 3, name: 'Zpeaker' }\n])\ncompaniesCollection.set([\n  { id: 1, name: 'Redbooth' },\n  { id: 2, name: 'Factorial' }\n])\ncompaniesCollection.get(1).get('name') // => 'Redbooth'\ncompaniesCollection.get(2).get('name') // => 'Factorial'\ncompaniesCollection.get(3) // => null\n```\n\n#### `build(attributes: Object): Model`\n\nInstantiates and links a model to the current collection.\n\n```js\nconst factorial = companiesCollection.build({ name: 'Factorial' })\nfactorial.collection === companiesCollection // => true\nfactorial.get('name') // 'Factorial'\n```\n\n#### `create(target: Object | Model, options: Object)`\n\nAdd and save to the server the given model. If attributes are given,\nalso it builds the model for you. It tracks the state of the request\nusing the label `creating`.\n\nOptions:\n\n  - `optimistic = true` Whether we want to create the resource in the client\n  first or wait for the server's response.\n\n```js\nconst promise = tasksCollection.create({ name: 'Do laundry' })\ntasksCollection.isRequest('creating') // => true\nawait promise\ntasksCollection.at(0).get('name') // => 'Do laundry'\n```\n\n#### `fetch(options: Object)`\n\nFetch the date from the server and then calls `set` to update the current\nmodels. Accepts any option from the `set` method.\n\n```js\nconst promise = tasksCollection.fetch()\ntasksCollection.isEmpty() // => true\ntasksCollection.isRequest('fetching') // => true\nawait promise\ntasksCollection.isEmpty() // => false\n```\n\n#### `rpc(method: 'string', body: {}): Promise`\n\nExactly the same as the model one, but at the collection level.\n\n### `apiClient`\n\nThis is the object that is going to make the `xhr` requests to interact with your API.\nThere are currently two implementations:\n\n  - One using `jQuery` in the [mobx-rest-jquery-adapter](https://github.com/masylum/mobx-rest-jquery-adapter) package.\n  - One using `fetch` in the [mobx-rest-fetch-adapter](https://github.com/masylum/mobx-rest-fetch-adapter) package.\n\nInitially you need to configure `apiClient()` with an adapter and the `apiPath`. You can also set additional options, like headers to send with all requests.\n\nFor example, if you're using JWT and need to send it using the Authorization header, it could look like this:\n```\nconst options = {\n  apiPath: window.env.apiUrl,\n}\nif (token) {\n  options.commonOptions = {\n    headers: {\n      Authorization: `Bearer ${token}`\n    }\n  }\n}\napiClient(adapter, options)\n```\n\nAll options:\n* **apiPath** (required): what do prepend for all model and collections URLs\n* **commonOptions**: settings to use for all requests\n  * **headers**: Additional request headers, like `Authorization`\n  * **tbd.**\n\n## Simple Example\n\nA collection looks like this:\n\n```js\n// TasksCollection.js\nconst apiPath = '/api'\nimport adapter from 'mobx-rest-fetch-adapter'\nimport { apiClient, Collection, Model } from 'mobx-rest'\n\n// We will use the adapter to make the `xhr` calls\napiClient(adapter, { apiPath })\n\nclass Task extends Model { }\nclass Tasks extends Collection {\n  url ()  { return `/tasks` }\n  model () { return Task }\n}\n\n// We instantiate the collection and export it as a singleton\nexport default new Tasks()\n```\n\nAnd here an example of how to use React with it:\n\n```js\nimport tasksCollection from './TasksCollection'\nimport { computed } from 'mobx'\nimport { observer } from 'mobx-react'\n\n@observer\nclass Task extends React.Component {\n  onClick () {\n    this.props.task.save({ resolved: true })\n  }\n\n  render () {\n    return (\n      <li key={task.id}>\n        <button onClick={this.onClick.bind(this)}>\n          resolve\n        </button>\n        {this.props.task.get('name')}\n      </li>\n    )\n  }\n}\n\n@observer\nclass Tasks extends React.Component {\n  componentWillMount () {\n    // This will call `/api/tasks?all=true`\n    tasksCollection.fetch({ data: { all: true } })\n  }\n\n  @computed\n  get activeTasks () {\n    return tasksCollection.filter({ resolved: false })\n  }\n\n  render () {\n    if (tasksCollection.isRequest('fetching')) {\n      return <span>Fetching tasks...</span>\n    }\n\n    return (\n      <div>\n        <span>{this.activeTasks.length} tasks</span>\n        <ul>{activeTasks.map((task) => <Task task={task} />)}</ul>\n      </div>\n    )\n  }\n}\n\n```\n\n## State shape\n\nYour collections and models will have the following state shape:\n\n### Collection\n\n```js\nmodels: Array<Model>      // This is where the models live\nrequest: {                // An ongoing request\n  label: string,          // Examples: 'updating', 'creating', 'fetching', 'destroying' ...\n  abort: () => void,      // A method to abort the ongoing request\n  progress: number        // If uploading a file, represents the progress\n},\nerror: {                  // A failed request\n  label: string,          // Examples: 'updating', 'creating', 'fetching', 'destroying' ...\n  body: Object,           // A string representing the error\n}\n```\n\n### Model\n\n```js\nattributes: Object    // The resource attributes\noptimisticId: string, // Client side id. Used for optimistic updates\nrequest: {            // An ongoing request\n  label: string,      // Examples: 'updating', 'creating', 'fetching', 'destroying' ...\n  abort: () => void,  // A method to abort the ongoing request\n},\nerror: {              // A failed request\n  label: string,      // Examples: 'updating', 'creating', 'fetching', 'destroying' ...\n  body: string,       // A string representing the error\n},\n```\n\n## FAQ\n\n### How do I create relations between the models?\n\nThis is something that mobx makes really easy to achieve:\n\n```js\nimport usersCollection from './UsersCollections'\nimport { computed } from 'mobx'\n\nclass Task extends Model {\n  @computed\n  author () {\n    const userId = this.get('userId')\n    return usersCollection.get(userId) ||\n      usersCollection.nullObject()\n  }\n}\n```\n\nI recommend to always fallback with a null object which will facilitate\na ton to write code like `task.author.get('name')`.\n\n## Where is it used?\n\nDeveloped and battle tested in production in [Factorial](https://factorialhr.com)\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2017 Pau Ramon <masylum@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"README.md"}