-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
thoughts #8
Comments
+1 For revamping the publishing process (also felt the same), feel free to send a PR on module-template this is what is being used for all the modules that are created here. Yup
Thank you for pitching in :) |
👍 |
@mattdesl Still interested? |
I have put some thoughts in it and I would prefer to change some stuff in the current implementation, to embrace a truly functional api.
f.e. - const blueLi = addClass(always('blue'), select('li'));
+ const blueLiIO = R.compose(R.map(addClass('blue')), select('li'));
+ blueLiIO.runIO();
// select :: String -> IO(Maybe(DomElement));
const select = function() { /** ... **/ }; |
The current API has only one feature (currying). With adding monads we would gain a lot more, and that is a side-effect free API for the DOM. |
Maybe we should also consider moving to a mono repo. It's much simpler to maintain/document and understand by new users. |
@mattdesl Totally agreed. IMO this should become a side-effect free, curried functional-api to the DOM using other modules or our own implementations. |
@stoeffel Agree. |
cool. |
and
Will be good to have, but would need a introduction as most of them from JS world would be new to it. I am not really a big fan of a mono repo... |
Yop, it would need a intro or some links. I can live without a mono repo. But I think it would make it a lot easier for new users to get started. We could still publish individual modules. |
const selectorAll = function(query) {
return new IO(function() {
return document.querySelectorAll(query) || [];
});
}
const innerHTML = R.lensProp('innerHTML');
const headInnerHtml = R.compose(
R.view(innerHTML)
, R.head
)
const lines = R.split('\n')
const text = R.compose(
R.map(
R.compose( R.toUpper
, R.head
, lines
, headInnerHtml
)
)
, selectorAll
);
console.log(text('h1').runIO()); |
Looks much better! Thanks. @stoeffel Let us create a todo list and attack this! |
Sure, let's do this. Would be cool to hear what @guumaster or @mattdesl thinks about this changes. |
I'm digging this. 👍 My two cents:
I was initially pretty confused reading through source, until I realized it was the transpiled output. Maybe it would be better to only transpile on prepublish, and avoid bloating github with transpiled code. Or, putting it in a
build
ordist
folder.It would also be great to embrace other modules a bit more rather than try to reinvent the wheel. Some inspiration:
The text was updated successfully, but these errors were encountered: