@norcy/react-native-toolkit 0.1.53 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.DS_Store +0 -0
- package/lib/commonjs/Notification.js +2 -2
- package/lib/commonjs/Notification.js.map +1 -1
- package/lib/module/Notification.js +2 -2
- package/lib/module/Notification.js.map +1 -1
- package/lib/typescript/Notification.d.ts +1 -1
- package/package.json +1 -1
- package/src/Notification.ts +2 -2
- package/.vscode/settings.json +0 -9
- package/ios/.DS_Store +0 -0
- package/ios/ReactNativeToolkit.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -4
- package/src/.DS_Store +0 -0
package/.DS_Store
CHANGED
|
Binary file
|
|
@@ -8,9 +8,9 @@ const EventEmitter = require('events').EventEmitter;
|
|
|
8
8
|
const eventEmitter = new EventEmitter();
|
|
9
9
|
const ListenerToEvent = {};
|
|
10
10
|
const Notification = exports.Notification = {
|
|
11
|
-
addListener: (event, callback) => {
|
|
11
|
+
addListener: (event, callback, skipCache) => {
|
|
12
12
|
const key = callback.toString();
|
|
13
|
-
if (!ListenerToEvent[key]) {
|
|
13
|
+
if (skipCache || !ListenerToEvent[key]) {
|
|
14
14
|
eventEmitter.on(event, callback);
|
|
15
15
|
ListenerToEvent[key] = event;
|
|
16
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EventEmitter","require","eventEmitter","ListenerToEvent","Notification","exports","addListener","event","callback","key","toString","on","addListenerOnce","once","removeListener","removeAllListeners","keys","Object","postNotification","args","emit"],"sources":["Notification.ts"],"sourcesContent":["const EventEmitter = require('events').EventEmitter;\nconst eventEmitter = new EventEmitter();\n\ninterface ListenerType {\n [key: string]: string;\n}\n\nconst ListenerToEvent: ListenerType = {};\n\nexport const Notification = {\n addListener: (event: string, callback: Function) => {\n const key = callback.toString();\n if (!ListenerToEvent[key]) {\n eventEmitter.on(event, callback);\n ListenerToEvent[key] = event;\n }\n return callback;\n },\n\n addListenerOnce: (event: string, callback: Function) => {\n eventEmitter.once(event, callback);\n },\n\n removeListener: (callback: Function) => {\n const key = callback.toString();\n const event = ListenerToEvent[key];\n delete ListenerToEvent[key];\n eventEmitter.removeListener(event, callback);\n },\n\n removeAllListeners: (event: string) => {\n const keys = Object.keys(ListenerToEvent);\n for (const key of keys) {\n if (ListenerToEvent[key] === event) {\n delete ListenerToEvent[key];\n }\n }\n eventEmitter.removeAllListeners(event);\n },\n\n postNotification: (event: string, args?: object) => {\n eventEmitter.emit(event, args);\n },\n};\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAGC,OAAO,CAAC,QAAQ,CAAC,CAACD,YAAY;AACnD,MAAME,YAAY,GAAG,IAAIF,YAAY,CAAC,CAAC;AAMvC,MAAMG,eAA6B,GAAG,CAAC,CAAC;AAEjC,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,WAAW,EAAEA,CAACC,KAAa,EAAEC,QAAkB,KAAK;
|
|
1
|
+
{"version":3,"names":["EventEmitter","require","eventEmitter","ListenerToEvent","Notification","exports","addListener","event","callback","skipCache","key","toString","on","addListenerOnce","once","removeListener","removeAllListeners","keys","Object","postNotification","args","emit"],"sources":["Notification.ts"],"sourcesContent":["const EventEmitter = require('events').EventEmitter;\nconst eventEmitter = new EventEmitter();\n\ninterface ListenerType {\n [key: string]: string;\n}\n\nconst ListenerToEvent: ListenerType = {};\n\nexport const Notification = {\n addListener: (event: string, callback: Function, skipCache?: boolean) => {\n const key = callback.toString();\n if (skipCache || !ListenerToEvent[key]) {\n eventEmitter.on(event, callback);\n ListenerToEvent[key] = event;\n }\n return callback;\n },\n\n addListenerOnce: (event: string, callback: Function) => {\n eventEmitter.once(event, callback);\n },\n\n removeListener: (callback: Function) => {\n const key = callback.toString();\n const event = ListenerToEvent[key];\n delete ListenerToEvent[key];\n eventEmitter.removeListener(event, callback);\n },\n\n removeAllListeners: (event: string) => {\n const keys = Object.keys(ListenerToEvent);\n for (const key of keys) {\n if (ListenerToEvent[key] === event) {\n delete ListenerToEvent[key];\n }\n }\n eventEmitter.removeAllListeners(event);\n },\n\n postNotification: (event: string, args?: object) => {\n eventEmitter.emit(event, args);\n },\n};\n"],"mappings":";;;;;;AAAA,MAAMA,YAAY,GAAGC,OAAO,CAAC,QAAQ,CAAC,CAACD,YAAY;AACnD,MAAME,YAAY,GAAG,IAAIF,YAAY,CAAC,CAAC;AAMvC,MAAMG,eAA6B,GAAG,CAAC,CAAC;AAEjC,MAAMC,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,WAAW,EAAEA,CAACC,KAAa,EAAEC,QAAkB,EAAEC,SAAmB,KAAK;IACvE,MAAMC,GAAG,GAAGF,QAAQ,CAACG,QAAQ,CAAC,CAAC;IAC/B,IAAIF,SAAS,IAAI,CAACN,eAAe,CAACO,GAAG,CAAC,EAAE;MACtCR,YAAY,CAACU,EAAE,CAACL,KAAK,EAAEC,QAAQ,CAAC;MAChCL,eAAe,CAACO,GAAG,CAAC,GAAGH,KAAK;IAC9B;IACA,OAAOC,QAAQ;EACjB,CAAC;EAEDK,eAAe,EAAEA,CAACN,KAAa,EAAEC,QAAkB,KAAK;IACtDN,YAAY,CAACY,IAAI,CAACP,KAAK,EAAEC,QAAQ,CAAC;EACpC,CAAC;EAEDO,cAAc,EAAGP,QAAkB,IAAK;IACtC,MAAME,GAAG,GAAGF,QAAQ,CAACG,QAAQ,CAAC,CAAC;IAC/B,MAAMJ,KAAK,GAAGJ,eAAe,CAACO,GAAG,CAAC;IAClC,OAAOP,eAAe,CAACO,GAAG,CAAC;IAC3BR,YAAY,CAACa,cAAc,CAACR,KAAK,EAAEC,QAAQ,CAAC;EAC9C,CAAC;EAEDQ,kBAAkB,EAAGT,KAAa,IAAK;IACrC,MAAMU,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACd,eAAe,CAAC;IACzC,KAAK,MAAMO,GAAG,IAAIO,IAAI,EAAE;MACtB,IAAId,eAAe,CAACO,GAAG,CAAC,KAAKH,KAAK,EAAE;QAClC,OAAOJ,eAAe,CAACO,GAAG,CAAC;MAC7B;IACF;IACAR,YAAY,CAACc,kBAAkB,CAACT,KAAK,CAAC;EACxC,CAAC;EAEDY,gBAAgB,EAAEA,CAACZ,KAAa,EAAEa,IAAa,KAAK;IAClDlB,YAAY,CAACmB,IAAI,CAACd,KAAK,EAAEa,IAAI,CAAC;EAChC;AACF,CAAC"}
|
|
@@ -2,9 +2,9 @@ const EventEmitter = require('events').EventEmitter;
|
|
|
2
2
|
const eventEmitter = new EventEmitter();
|
|
3
3
|
const ListenerToEvent = {};
|
|
4
4
|
export const Notification = {
|
|
5
|
-
addListener: (event, callback) => {
|
|
5
|
+
addListener: (event, callback, skipCache) => {
|
|
6
6
|
const key = callback.toString();
|
|
7
|
-
if (!ListenerToEvent[key]) {
|
|
7
|
+
if (skipCache || !ListenerToEvent[key]) {
|
|
8
8
|
eventEmitter.on(event, callback);
|
|
9
9
|
ListenerToEvent[key] = event;
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EventEmitter","require","eventEmitter","ListenerToEvent","Notification","addListener","event","callback","key","toString","on","addListenerOnce","once","removeListener","removeAllListeners","keys","Object","postNotification","args","emit"],"sources":["Notification.ts"],"sourcesContent":["const EventEmitter = require('events').EventEmitter;\nconst eventEmitter = new EventEmitter();\n\ninterface ListenerType {\n [key: string]: string;\n}\n\nconst ListenerToEvent: ListenerType = {};\n\nexport const Notification = {\n addListener: (event: string, callback: Function) => {\n const key = callback.toString();\n if (!ListenerToEvent[key]) {\n eventEmitter.on(event, callback);\n ListenerToEvent[key] = event;\n }\n return callback;\n },\n\n addListenerOnce: (event: string, callback: Function) => {\n eventEmitter.once(event, callback);\n },\n\n removeListener: (callback: Function) => {\n const key = callback.toString();\n const event = ListenerToEvent[key];\n delete ListenerToEvent[key];\n eventEmitter.removeListener(event, callback);\n },\n\n removeAllListeners: (event: string) => {\n const keys = Object.keys(ListenerToEvent);\n for (const key of keys) {\n if (ListenerToEvent[key] === event) {\n delete ListenerToEvent[key];\n }\n }\n eventEmitter.removeAllListeners(event);\n },\n\n postNotification: (event: string, args?: object) => {\n eventEmitter.emit(event, args);\n },\n};\n"],"mappings":"AAAA,MAAMA,YAAY,GAAGC,OAAO,CAAC,QAAQ,CAAC,CAACD,YAAY;AACnD,MAAME,YAAY,GAAG,IAAIF,YAAY,CAAC,CAAC;AAMvC,MAAMG,eAA6B,GAAG,CAAC,CAAC;AAExC,OAAO,MAAMC,YAAY,GAAG;EAC1BC,WAAW,EAAEA,CAACC,KAAa,EAAEC,QAAkB,KAAK;
|
|
1
|
+
{"version":3,"names":["EventEmitter","require","eventEmitter","ListenerToEvent","Notification","addListener","event","callback","skipCache","key","toString","on","addListenerOnce","once","removeListener","removeAllListeners","keys","Object","postNotification","args","emit"],"sources":["Notification.ts"],"sourcesContent":["const EventEmitter = require('events').EventEmitter;\nconst eventEmitter = new EventEmitter();\n\ninterface ListenerType {\n [key: string]: string;\n}\n\nconst ListenerToEvent: ListenerType = {};\n\nexport const Notification = {\n addListener: (event: string, callback: Function, skipCache?: boolean) => {\n const key = callback.toString();\n if (skipCache || !ListenerToEvent[key]) {\n eventEmitter.on(event, callback);\n ListenerToEvent[key] = event;\n }\n return callback;\n },\n\n addListenerOnce: (event: string, callback: Function) => {\n eventEmitter.once(event, callback);\n },\n\n removeListener: (callback: Function) => {\n const key = callback.toString();\n const event = ListenerToEvent[key];\n delete ListenerToEvent[key];\n eventEmitter.removeListener(event, callback);\n },\n\n removeAllListeners: (event: string) => {\n const keys = Object.keys(ListenerToEvent);\n for (const key of keys) {\n if (ListenerToEvent[key] === event) {\n delete ListenerToEvent[key];\n }\n }\n eventEmitter.removeAllListeners(event);\n },\n\n postNotification: (event: string, args?: object) => {\n eventEmitter.emit(event, args);\n },\n};\n"],"mappings":"AAAA,MAAMA,YAAY,GAAGC,OAAO,CAAC,QAAQ,CAAC,CAACD,YAAY;AACnD,MAA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CAAC;EAChC;AACF,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const Notification: {
|
|
2
|
-
addListener: (event: string, callback: Function) => Function;
|
|
2
|
+
addListener: (event: string, callback: Function, skipCache?: boolean) => Function;
|
|
3
3
|
addListenerOnce: (event: string, callback: Function) => void;
|
|
4
4
|
removeListener: (callback: Function) => void;
|
|
5
5
|
removeAllListeners: (event: string) => void;
|
package/package.json
CHANGED
package/src/Notification.ts
CHANGED
|
@@ -8,9 +8,9 @@ interface ListenerType {
|
|
|
8
8
|
const ListenerToEvent: ListenerType = {};
|
|
9
9
|
|
|
10
10
|
export const Notification = {
|
|
11
|
-
addListener: (event: string, callback: Function) => {
|
|
11
|
+
addListener: (event: string, callback: Function, skipCache?: boolean) => {
|
|
12
12
|
const key = callback.toString();
|
|
13
|
-
if (!ListenerToEvent[key]) {
|
|
13
|
+
if (skipCache || !ListenerToEvent[key]) {
|
|
14
14
|
eventEmitter.on(event, callback);
|
|
15
15
|
ListenerToEvent[key] = event;
|
|
16
16
|
}
|
package/.vscode/settings.json
DELETED
package/ios/.DS_Store
DELETED
|
Binary file
|
package/src/.DS_Store
DELETED
|
Binary file
|