-
-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Labels
RFCSome new feature that should be discussedSome new feature that should be discussed
Description
Hi! I don’t think I’ve seen the operator for the includes
method, but it can be very useful. What do you think about it? Also, it is possible to combine includes for arrays and strings.
const $array = createStore([1, 2, 3]);
const $string = createStore('Hello world!');
const $findInArray = createStore<number>(1);
const $findInString = createStore<string>('Hello');
const $isInclude = includes($array, 1);
const $isInclude = includes($array, $findInArray);
const $isInclude = includes($string, 'Hello');
const $isInclude = includes($string, $findInString);
Instead of combine
const $array = createStore([1, 2, 3]);
const $string = createStore('Hello world!');
const $findInArray = createStore<number>(1);
const $findInString = createStore<string>('Hello');
const $isInclude = combine($string, $findInString, (string, findInString) =>
string.includes(findInString),
);
sergeysova and navaru
Metadata
Metadata
Assignees
Labels
RFCSome new feature that should be discussedSome new feature that should be discussed