{"id":15994285,"url":"https://github.com/pixelhandler/ember-fetchjax","last_synced_at":"2025-04-05T00:15:50.965Z","repository":{"id":57223743,"uuid":"72896935","full_name":"pixelhandler/ember-fetchjax","owner":"pixelhandler","description":"Ember addon to use Fetch or AJAX","archived":false,"fork":false,"pushed_at":"2017-03-09T14:51:11.000Z","size":39,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-11T02:48:04.848Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelhandler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-11-05T01:08:19.000Z","updated_at":"2016-11-15T17:49:48.000Z","dependencies_parsed_at":"2022-08-30T02:40:27.063Z","dependency_job_id":null,"html_url":"https://github.com/pixelhandler/ember-fetchjax","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-fetchjax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-fetchjax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-fetchjax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fember-fetchjax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelhandler","download_url":"https://codeload.github.com/pixelhandler/ember-fetchjax/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247266569,"owners_count":20910837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T07:08:06.735Z","updated_at":"2025-04-05T00:15:50.947Z","avatar_url":"https://github.com/pixelhandler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember-fetchjax\n\nEmber Addon to use Fetch or AJAX.\n\nThe default behavior is to use Fetch when available, otherwise to use AJAX.\n\n[![Build Status](https://travis-ci.org/pixelhandler/ember-fetchjax.svg?branch=master)](https://travis-ci.org/pixelhandler/ember-fetchjax)\n[![Ember Observer Score](http://emberobserver.com/badges/ember-fetchjax.svg)](http://emberobserver.com/addons/ember-fetchjax)\n[![npm](https://img.shields.io/npm/v/ember-fetchjax.svg)](https://www.npmjs.com/package/ember-fetchjax)\n\n- Provides a set of utils to use in an Ember app, however the utils do\n  not require Ember, they are just JavaScript classes\n  - See the addon/utils directory\n- No polyfill for `window.fetch` or `window.Promise` required\n  - If you want to use a polyfill see the bower projects `es6-promise`\n    and `fetch`\n- Setup a `fetchjax.fetch` method to use AJAX or Fetch\n  - `FetchOrAjax` constructor requires dependencies, e.g. `jQuery.ajax`\n  - Instance defaults to native Fetch and Promise, unless you pass in\n    `Ember.RSVP.Promise`, or another `fetch` method\n- See the `dummy` app and acceptance tests for example use\n\n\n## Usage\n\nExample route that defaults to use Fetch, but falls back to AJAX:\n\n```js\nimport Ember from 'ember';\nimport FetchOrAjax from 'ember-fetchjax/utils/fetchjax';\n\nconst fetchjax = new FetchOrAjax({ajax: Ember.$.ajax});\n\nexport default Ember.Route.extend({\n  model() {\n    return fetchjax.fetch('/api/v1/posts', {method: 'GET'});\n  }\n});\n\n```\n\nExample route the forces the use of XHR:\n\n```js\nimport Ember from 'ember';\nimport FetchOrAjax from 'ember-fetchjax/utils/fetchjax';\n\nconst fetchjax = new FetchOrAjax({useAjax: true, ajax: Ember.$.ajax});\n\nexport default Ember.Route.extend({\n  model() {\n    return fetchjax.fetch('/api/v1/posts', {method: 'GET'});\n  }\n});\n\n```\n\n\n## Installation\n\nInstall addon…\n\n* `ember install ember-fetchjax`\n\nInstall for local development…\n\n* `git clone \u003crepository-url\u003e` this repository\n* `cd ember-fetchjax`\n* `npm install`\n* `bower install`\n\n## Running\n\n* `ember serve --proxy http://api.pixelhandler.com`\n* Try with Fetch or AJAX [http://localhost:4200/fetch](http://localhost:4200/fetch).\n* AJAX only [http://localhost:4200/ajax](http://localhost:4200/ajax).\n\n## Running Tests\n\n* `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)\n* `ember test`\n* `ember test --server`\n\n## Building\n\n* `ember build`\n\nFor more information on using ember-cli, visit [http://ember-cli.com/](http://ember-cli.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fember-fetchjax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelhandler%2Fember-fetchjax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fember-fetchjax/lists"}