Repository: meinto/react-native-event-listeners
Branch: master
Commit: 5a73c7afc2d5
Files: 17
Total size: 20.6 KB
Directory structure:
gitextract_p8pemzyh/
├── .babelrc
├── .buckconfig
├── .eslintrc.js
├── .flowconfig
├── .gitattributes
├── .gitignore
├── .travis.yml
├── .watchmanconfig
├── LICENSE
├── README.md
├── __tests__/
│ ├── __snapshots__/
│ │ └── index.test.js.snap
│ └── index.test.js
├── app.json
├── index.d.ts
├── index.js
├── jsconfig.json
└── package.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": ["@babel/preset-env"],
"plugins": [
"@babel/plugin-syntax-class-properties",
"@babel/plugin-proposal-class-properties",
]
}
================================================
FILE: .buckconfig
================================================
[android]
target = Google Inc.:Google APIs:23
[maven_repositories]
central = https://repo1.maven.org/maven2
================================================
FILE: .eslintrc.js
================================================
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jest": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react",
"react-native",
"classes",
],
"globals": {
"dip" : true,
"fdip" : true,
"globalBackHandler": true,
"jasmine": true,
"idx": true,
},
"parser": "babel-eslint",
"rules": {
"classes/space": 2,
"classes/name": [2, "class", "method"],
"classes/style": 2,
"strict": 0,
"prefer-const": "error",
"react/prop-types": [
"error",{}
],
"brace-style": "error",
"new-cap": ["error",
{ "newIsCap": true }
],
"block-spacing": "error",
"keyword-spacing":"error",
"no-irregular-whitespace": "error",
"space-in-parens": ["error", "never"],
"space-unary-ops": "error",
"space-before-function-paren": ["error", "never"],
"no-multi-spaces": "error",
"comma-spacing": ["error", { "before": false, "after": true }],
"computed-property-spacing": ["error", "never"],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"no-lonely-if": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 1 }],
"space-infix-ops": "error",
"indent": [
"error",
2,
{ "SwitchCase": 1 }
],
/*"linebreak-style": [
"error",
"unix"
],*/
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
],
"comma-dangle": [
"error",
"always-multiline"
],
"arrow-spacing": [
"error"
],
"max-len": ["error", 130],
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"react-native/no-unused-styles": 2,
"react-native/split-platform-components": 0,
"react-native/no-inline-styles": 2,
"react-native/no-color-literals": 0,
}
};
================================================
FILE: .flowconfig
================================================
[ignore]
; We fork some components by platform
.*/*[.]android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
.*/Libraries/react-native/ReactNative.js
[include]
[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/
[options]
emoji=true
module.system=haste
experimental.strict_type_args=true
munge_underscores=true
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-0]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
unsafe.enable_getters_and_setters=true
[version]
^0.40.0
================================================
FILE: .gitattributes
================================================
*.pbxproj -text
================================================
FILE: .gitignore
================================================
# OSX
#
.DS_Store
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml
# node.js
#
node_modules/
npm-debug.log
yarn-error.log
# BUCK
buck-out/
\.buckd/
*.keystore
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
coverage/
================================================
FILE: .travis.yml
================================================
language: node_js
node_js:
- "stable"
after_success: 'npm run coveralls'
================================================
FILE: .watchmanconfig
================================================
{}
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2017-2018 Tobias Meinhardt
Permission 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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE 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.
================================================
FILE: README.md
================================================
# React Native Event Listeners
(This package isn't only restricted to react-native projects. The source is written in plain js with no dependencies to react-native.)
[](https://opencollective.com/react-native-event-listeners) [](https://badge.fury.io/js/react-native-event-listeners)
[](https://david-dm.org/tobiasMeinhardt/react-native-event-listeners)
[](https://david-dm.org/tobiasMeinhardt/react-native-event-listeners?type=dev)
[](https://www.npmjs.com/package/react-native-event-listeners)
[](https://www.npmjs.com/package/react-native-event-listeners)
[](https://travis-ci.org/meinto/react-native-event-listeners)
[](https://coveralls.io/github/meinto/react-native-event-listeners?branch=master)
## Why
In some very specific cases it can be charming to have a simple global event listener. While working with global event listeners **you don't have to pass touch events through the component tree** into other components or can **bypass easily the redux architecture** for example.
## Installation
```
npm install --save react-native-event-listeners
```
or
```
yarn add react-native-event-listeners
```
## Usage Example
*Hint: The event listeners also work across different files. You only have to import the ```EventRegister``` in every file you need to send or receive your events.*
```javascript
import { EventRegister } from 'react-native-event-listeners'
/*
* RECEIVER COMPONENT
*/
class Receiver extends PureComponent {
constructor(props) {
super(props)
this.state = {
data: 'no data',
}
}
componentWillMount() {
this.listener = EventRegister.addEventListener('myCustomEvent', (data) => {
this.setState({
data,
})
})
}
componentWillUnmount() {
EventRegister.removeEventListener(this.listener)
}
render() {
return <Text>{this.state.data}</Text>
}
}
/*
* SENDER COMPONENT
*/
const Sender = (props) => (
<TouchableHighlight
onPress={() => {
EventRegister.emit('myCustomEvent', 'it works!!!')
})
><Text>Send Event</Text></TouchableHighlight>
)
```
## API
```javascript
// import
import { EventRegister } from 'react-native-event-listeners'
```
| static method | return value | description |
| :------------------ | :---------------- | :------------------------------------------------------------- |
| addEventListener | string \| boolean | return value is the id of the event listener or false on error |
| removeEventListener | boolean | true on success otherwise false |
| removeAllListeners | boolean | true on success otherwise false |
| emitEvent | void | no return value |
| on | string \| boolean | **shorthand** for addEventListener |
| rm | boolean | **shorthand** for removeEventListener |
| rmAll | boolean | **shorthand** for removeAllListeners |
| emit | void | **shorthand** for emitEvent |
## Contributors
### Code Contributors
This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/meinto/react-native-event-listeners/graphs/contributors"><img src="https://opencollective.com/react-native-event-listeners/contributors.svg?width=890&button=false" /></a>
### Financial Contributors
Become a financial contributor and help us sustain our community. [[Contribute](https://opencollective.com/react-native-event-listeners/contribute)]
#### Individuals
<a href="https://opencollective.com/react-native-event-listeners"><img src="https://opencollective.com/react-native-event-listeners/individuals.svg?width=890"></a>
#### Organizations
Support this project with your organization. Your logo will show up here with a link to your website. [[Contribute](https://opencollective.com/react-native-event-listeners/contribute)]
<a href="https://opencollective.com/react-native-event-listeners/organization/0/website"><img src="https://opencollective.com/react-native-event-listeners/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/1/website"><img src="https://opencollective.com/react-native-event-listeners/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/2/website"><img src="https://opencollective.com/react-native-event-listeners/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/3/website"><img src="https://opencollective.com/react-native-event-listeners/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/4/website"><img src="https://opencollective.com/react-native-event-listeners/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/5/website"><img src="https://opencollective.com/react-native-event-listeners/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/6/website"><img src="https://opencollective.com/react-native-event-listeners/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/7/website"><img src="https://opencollective.com/react-native-event-listeners/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/8/website"><img src="https://opencollective.com/react-native-event-listeners/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/react-native-event-listeners/organization/9/website"><img src="https://opencollective.com/react-native-event-listeners/organization/9/avatar.svg"></a>
================================================
FILE: __tests__/__snapshots__/index.test.js.snap
================================================
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`EventRegister tests tests that eventlisteners are added properly 1`] = `
Object {
"count": 3,
"refs": Object {
"l1": Object {
"callback": [Function],
"name": "test",
},
"l2": Object {
"callback": [Function],
"name": "test",
},
"l3": Object {
"callback": [Function],
"name": "test",
},
},
}
`;
exports[`EventRegister tests tests that removeAllListeners works properly 1`] = `
Object {
"count": 3,
"refs": Object {},
}
`;
exports[`EventRegister tests tests that removeEventListener works properly 1`] = `
Object {
"count": 3,
"refs": Object {
"l1": Object {
"callback": [Function],
"name": "test",
},
"l3": Object {
"callback": [Function],
"name": "test",
},
},
}
`;
================================================
FILE: __tests__/index.test.js
================================================
import { EventRegister } from '../index'
describe('EventRegister tests', () => {
beforeEach(() => {
EventRegister._Listeners = {
count: 0,
refs: {},
}
})
const _addEventListener = (name = 'test', func = () => {}) => {
return EventRegister.addEventListener(name, func)
}
it('tests that eventlisteners are added properly', () => {
const id = _addEventListener()
_addEventListener()
_addEventListener()
expect(id).toBe('l1')
expect(EventRegister._Listeners).toMatchSnapshot()
})
it('tests that removeEventListener works properly', () => {
_addEventListener()
const id = _addEventListener()
_addEventListener()
const removed = EventRegister.removeEventListener(id)
expect(EventRegister._Listeners).toMatchSnapshot()
expect(removed).toBe(true)
const removed2 = EventRegister.removeEventListener('idNotAvailable')
expect(removed2).toBe(true)
const removed3 = EventRegister.removeEventListener(123)
expect(removed3).toBe(false)
})
it('tests that removeAllListeners works properly', () => {
_addEventListener()
_addEventListener()
_addEventListener()
const removed = EventRegister.removeAllListeners()
expect(EventRegister._Listeners).toMatchSnapshot()
expect(removed).toBe(true)
})
it('tests that emitEvent works properly', () => {
const mockFunc1 = jest.fn()
const mockFunc2 = jest.fn()
const mockFunc3 = jest.fn()
_addEventListener('test1', mockFunc1)
_addEventListener('test2', mockFunc2)
_addEventListener('test3', mockFunc3)
EventRegister.emitEvent('test1', { mockValue: 'mock 1' })
expect(mockFunc1).toHaveBeenCalledWith({ mockValue: 'mock 1' })
EventRegister.emitEvent('test3', { mockValue: 'mock 3' })
expect(mockFunc3).toHaveBeenCalledWith({ mockValue: 'mock 3' })
})
it('tests that removed callbacks are not called', () => {
const mockFunc1 = jest.fn()
const mockFunc2 = jest.fn()
const mockFunc3 = jest.fn()
const id = _addEventListener('test1', mockFunc1)
_addEventListener('test2', mockFunc2)
_addEventListener('test3', mockFunc3)
EventRegister.removeEventListener(id)
EventRegister.emitEvent('test1', { mockValue: 'mock 1' })
expect(mockFunc1).not.toHaveBeenCalled()
EventRegister.emitEvent('test3', { mockValue: 'mock 3' })
expect(mockFunc3).toHaveBeenCalledWith({ mockValue: 'mock 3' })
_addEventListener('test1', mockFunc1)
EventRegister.emitEvent('test1', { mockValue: 'mock 1' })
expect(mockFunc1).toHaveBeenCalledWith({ mockValue: 'mock 1' })
})
/* shorthands */
it('tests that addEventListener is called with shorthand "on"', () => {
EventRegister.addEventListener = jest.fn()
const func = jest.fn()
EventRegister.on('name', func)
expect(EventRegister.addEventListener).toHaveBeenCalledWith('name', func)
})
it('tests that removeEventListener is called with shorthand "rm"', () => {
EventRegister.removeEventListener = jest.fn(() => {
return 'removed'
})
const id = _addEventListener()
const removed = EventRegister.rm(id)
expect(EventRegister.removeEventListener).toHaveBeenCalledWith(id)
expect(removed).toBe('removed')
})
it('tests that removeAllListeners is called with shorthand "rmAll"', () => {
EventRegister.removeAllListeners = jest.fn(() => {
return 'removed'
})
_addEventListener()
_addEventListener()
_addEventListener()
const removed = EventRegister.rmAll()
expect(EventRegister.removeAllListeners).toHaveBeenCalled()
expect(removed).toBe('removed')
})
it('tests that emitEvent is called with shorthand "emit"', () => {
EventRegister.emitEvent = jest.fn()
EventRegister.emit('test', {
mockValue: 'val',
})
expect(EventRegister.emitEvent).toHaveBeenCalledWith('test', {
mockValue: 'val',
})
})
})
================================================
FILE: app.json
================================================
{
"name": "reactNativeMirror",
"displayName": "reactNativeMirror"
}
================================================
FILE: index.d.ts
================================================
declare module 'react-native-event-listeners' {
type Callback = (data: any) => void;
class EventRegister {
public static addEventListener(eventName: string, callback: Callback): string | boolean
public static removeEventListener(id: string): boolean
public static removeAllListeners(): boolean
public static emitEvent(eventName: string, data?: any): void
// shortener
public static on(eventName: string, callback: Callback): string | boolean
public static rm(id: string): boolean
public static rmAll(): boolean
public static emit(eventName: string, data?: any): void
}
export { EventRegister };
}
================================================
FILE: index.js
================================================
import type from 'type-detect'
class EventRegister {
static _Listeners = {
count: 0,
refs: {},
}
static addEventListener(eventName, callback) {
if (
type(eventName) === 'string' &&
type(callback) === 'function'
) {
EventRegister._Listeners.count++
const eventId = 'l' + EventRegister._Listeners.count
EventRegister._Listeners.refs[eventId] = {
name: eventName,
callback,
}
return eventId
}
return false
}
static removeEventListener(id) {
if (type(id) === 'string') {
return delete EventRegister._Listeners.refs[id]
}
return false
}
static removeAllListeners() {
let removeError = false
Object.keys(EventRegister._Listeners.refs).forEach(_id => {
const removed = delete EventRegister._Listeners.refs[_id]
removeError = (!removeError) ? !removed : removeError
})
return !removeError
}
static emitEvent(eventName, data) {
Object.keys(EventRegister._Listeners.refs).forEach(_id => {
if (
EventRegister._Listeners.refs[_id] &&
eventName === EventRegister._Listeners.refs[_id].name
)
EventRegister._Listeners.refs[_id].callback(data)
})
}
/*
* shortener
*/
static on(eventName, callback) {
return EventRegister.addEventListener(eventName, callback)
}
static rm(eventName) {
return EventRegister.removeEventListener(eventName)
}
static rmAll() {
return EventRegister.removeAllListeners()
}
static emit(eventName, data) {
EventRegister.emitEvent(eventName, data)
}
}
export { EventRegister }
================================================
FILE: jsconfig.json
================================================
{
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
================================================
FILE: package.json
================================================
{
"name": "react-native-event-listeners",
"version": "1.0.7",
"author": "Tobias Meinhardt <tobias.meinhardt89@gmail.com>",
"main": "index.js",
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest --no-cache",
"coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls"
},
"repository": {
"type": "git",
"url": "https://github.com/tobiasMeinhardt/react-native-event-listeners"
},
"bugs": {
"url": "https://github.com/tobiasMeinhardt/react-native-event-listeners/issues"
},
"keywords": [
"react",
"react-native",
"event listeners",
"listeners",
"events"
],
"tags": [
"react",
"react-native",
"event listeners",
"listeners",
"events"
],
"license": "MIT",
"dependencies": {
"type-detect": "^4.0.8"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.7.0",
"@babel/plugin-syntax-class-properties": "^7.2.0",
"@babel/preset-env": "^7.7.1",
"coveralls": "^3.0.7",
"jest": "^24.9.0"
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"index.js"
]
}
}
gitextract_p8pemzyh/ ├── .babelrc ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .travis.yml ├── .watchmanconfig ├── LICENSE ├── README.md ├── __tests__/ │ ├── __snapshots__/ │ │ └── index.test.js.snap │ └── index.test.js ├── app.json ├── index.d.ts ├── index.js ├── jsconfig.json └── package.json
SYMBOL INDEX (11 symbols across 2 files)
FILE: index.d.ts
type Callback (line 2) | type Callback = (data: any) => void;
class EventRegister (line 4) | class EventRegister {
FILE: index.js
class EventRegister (line 3) | class EventRegister {
method addEventListener (line 10) | static addEventListener(eventName, callback) {
method removeEventListener (line 26) | static removeEventListener(id) {
method removeAllListeners (line 33) | static removeAllListeners() {
method emitEvent (line 42) | static emitEvent(eventName, data) {
method on (line 55) | static on(eventName, callback) {
method rm (line 59) | static rm(eventName) {
method rmAll (line 63) | static rmAll() {
method emit (line 67) | static emit(eventName, data) {
Condensed preview — 17 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (23K chars).
[
{
"path": ".babelrc",
"chars": 152,
"preview": "{\n \"presets\": [\"@babel/preset-env\"],\n \"plugins\": [ \n \"@babel/plugin-syntax-class-properties\", \n \"@babel/plugin-p"
},
{
"path": ".buckconfig",
"chars": 114,
"preview": "\n[android]\n target = Google Inc.:Google APIs:23\n\n[maven_repositories]\n central = https://repo1.maven.org/maven2\n"
},
{
"path": ".eslintrc.js",
"chars": 2125,
"preview": "module.exports = {\n \"env\": {\n \"browser\": true,\n \"commonjs\": true,\n \"es6\": true,\n \"jest\": true\n\n },\n \"exte"
},
{
"path": ".flowconfig",
"chars": 1421,
"preview": "[ignore]\n; We fork some components by platform\n.*/*[.]android.js\n\n; Ignore \"BUCK\" generated dirs\n<PROJECT_ROOT>/\\.buckd/"
},
{
"path": ".gitattributes",
"chars": 16,
"preview": "*.pbxproj -text\n"
},
{
"path": ".gitignore",
"chars": 785,
"preview": "# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.p"
},
{
"path": ".travis.yml",
"chars": 74,
"preview": "language: node_js\nnode_js:\n - \"stable\"\nafter_success: 'npm run coveralls'"
},
{
"path": ".watchmanconfig",
"chars": 2,
"preview": "{}"
},
{
"path": "LICENSE",
"chars": 1087,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2017-2018 Tobias Meinhardt\n\nPermission is hereby granted, free of charge, to any pe"
},
{
"path": "README.md",
"chars": 6896,
"preview": "# React Native Event Listeners\n\n(This package isn't only restricted to react-native projects. The source is written in p"
},
{
"path": "__tests__/__snapshots__/index.test.js.snap",
"chars": 837,
"preview": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`EventRegister tests tests that eventlisteners are added properly 1`"
},
{
"path": "__tests__/index.test.js",
"chars": 3922,
"preview": "import { EventRegister } from '../index'\n\ndescribe('EventRegister tests', () => {\n\n beforeEach(() => {\n EventRegiste"
},
{
"path": "app.json",
"chars": 71,
"preview": "{\n \"name\": \"reactNativeMirror\",\n \"displayName\": \"reactNativeMirror\"\n}"
},
{
"path": "index.d.ts",
"chars": 650,
"preview": "declare module 'react-native-event-listeners' {\n type Callback = (data: any) => void;\n\n class EventRegister {\n publ"
},
{
"path": "index.js",
"chars": 1629,
"preview": "import type from 'type-detect'\n\nclass EventRegister {\n\n static _Listeners = {\n count: 0,\n refs: {},\n }\n\n static"
},
{
"path": "jsconfig.json",
"chars": 151,
"preview": "{\n \"compilerOptions\": {\n \"allowJs\": true,\n \"allowSyntheticDefaultImports\": true\n },\n \"exclude\": ["
},
{
"path": "package.json",
"chars": 1174,
"preview": "{\n \"name\": \"react-native-event-listeners\",\n \"version\": \"1.0.7\",\n \"author\": \"Tobias Meinhardt <tobias.meinhardt89@gmai"
}
]
About this extraction
This page contains the full source code of the meinto/react-native-event-listeners GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 17 files (20.6 KB), approximately 5.8k tokens, and a symbol index with 11 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.