Skip to content

Commit c80baef

Browse files
committed
React
1 parent 4ac65f1 commit c80baef

File tree

8 files changed

+8642
-3
lines changed

8 files changed

+8642
-3
lines changed

gulpfile.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {promises} from 'fs';
44

55
const ALL_MODULES = [
66
'tinybase',
7+
'ui-react',
78
'store',
89
'checkpoints',
910
'indexes',
@@ -131,7 +132,7 @@ const tsCheck = async (dir) => {
131132
const unusedResults = Object.entries(
132133
unusedExports(`${dir}/tsconfig.json`, [
133134
'--allowUnusedTypes',
134-
'--excludePathsFromReport=tinybase.ts',
135+
'--excludePathsFromReport=tinybase.ts;ui-react.ts',
135136
]),
136137
)
137138
.map(
@@ -185,7 +186,11 @@ const compileModule = async (module, debug, dir = LIB_DIR, format = 'es') => {
185186
interop: 'default',
186187
name:
187188
'TinyBase' +
188-
(module == 'tinybase' ? '' : module[0].toUpperCase() + module.slice(1)),
189+
(module == 'tinybase'
190+
? ''
191+
: module == 'ui-react'
192+
? 'UiReact'
193+
: module[0].toUpperCase() + module.slice(1)),
189194
},
190195
};
191196

src/common/array.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export const arrayForEach = <Value>(
1919
cb: (value: Value, index: number) => void,
2020
): void => array.forEach(cb);
2121

22+
export const arrayMap = <Value, Return>(
23+
array: Value[],
24+
cb: (value: Value, index: number, array: Value[]) => Return,
25+
): Return[] => array.map(cb);
26+
2227
export const arraySum = (array: number[]): number =>
2328
arrayReduce(array, (i, j) => i + j, 0);
2429

src/common/obj.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const objFreeze = object.freeze;
1313
export const isObject = (obj: unknown): boolean =>
1414
isInstanceOf(obj, object) && (obj as any).constructor == object;
1515

16-
const objGet = <Value>(
16+
export const objGet = <Value>(
1717
obj: IdObj<Value> | Value[] | undefined,
1818
id: Id,
1919
): Value | undefined => ifNotUndefined(obj, (obj) => (obj as IdObj<Value>)[id]);

0 commit comments

Comments
 (0)