{"id":17941037,"url":"https://github.com/dash-os/saga-geolocation-observer","last_synced_at":"2025-04-03T12:43:26.021Z","repository":{"id":65492394,"uuid":"92863256","full_name":"Dash-OS/saga-geolocation-observer","owner":"Dash-OS","description":"Use saga-observables to provide a simple way to use the HTML5 Geolocation API with redux-saga","archived":false,"fork":false,"pushed_at":"2017-05-30T20:02:56.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T13:38:12.925Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Dash-OS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-30T18:23:02.000Z","updated_at":"2021-09-17T04:42:25.000Z","dependencies_parsed_at":"2023-01-25T19:35:11.383Z","dependency_job_id":null,"html_url":"https://github.com/Dash-OS/saga-geolocation-observer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dash-OS%2Fsaga-geolocation-observer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dash-OS%2Fsaga-geolocation-observer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dash-OS%2Fsaga-geolocation-observer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Dash-OS%2Fsaga-geolocation-observer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Dash-OS","download_url":"https://codeload.github.com/Dash-OS/saga-geolocation-observer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247005397,"owners_count":20868019,"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-29T01:04:52.629Z","updated_at":"2025-04-03T12:43:26.001Z","avatar_url":"https://github.com/Dash-OS.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# saga-geolocation-observer\n\nUses [saga-observable](https://www.npmjs.com/package/saga-observable) to provide a\nsimple way to user the [watchPosition](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition) \nAPI.\n\n### Installation\n\n```\nyarn add saga-geolocation-observer\n```\n\n**or**\n\n```\nnpm install --save saga-geolocation-observer\n```\n\n### Simple Example\n\n```js\nimport { put, fork } = 'redux-saga/effects'\nimport startLocationObserver from 'saga-geolocation-observer'\n\nfunction* mySaga(foo, bar, ctx) {\n\n  const task = yield fork(\n    startLocationObserver,\n    'watch-position-observer', // uid\n    { enableHighAccuracy: true }, // PositionOptions (@ https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions )\n    {\n      onEvent:  handleEvent,\n      onError:  handleError,\n      // optionally use [ context, fn ] for binding context.\n      onCancel: [ ctx, handleCancellation ] ,\n      // called when finally is reached (catch or cancel)\n      onFinally: handleComplete,\n    }, // optional lifecycle events, called as saga if possible.\n    /* pass through args are sent to the handlers */\n    foo, bar\n  )\n  \n}\n\nfunction* handleEvent(event, value, uid, ...passThroughArgs) {\n  yield put({\n    type: 'LOCATION_EVENT',\n    event, // 'watchPosition'\n    value, // Position (@ https://developer.mozilla.org/en-US/docs/Web/API/Position)\n    uid, // 'watch-position-observer'\n    passThroughArgs, // [ foo, bar ]\n  })\n}\n\nfunction* handleError(event, error, uid, ...passThroughArgs) {\n  /* ... handle error ... */\n}\n\nfunction* handleCancellation(event, uid, ...passThroughArgs) {\n  /* ... handle cancellation ... */\n}\n\nfunction* handleComplete(event, uid, ...passThroughArgs) {\n  /* ... handle finished ... */\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdash-os%2Fsaga-geolocation-observer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdash-os%2Fsaga-geolocation-observer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdash-os%2Fsaga-geolocation-observer/lists"}